Hi,
just try to insert the two lines (wsSch.unprotect "international" and wsSch.protect "international" )
and it should work (untestested)
Sub btn_Submit_Click()
Dim wsReq As Worksheet 'Request worksheet (Request Form)
Dim wsSch As Worksheet 'Schedule worksheet (Only to be seen by Admin)
Dim rngFindName As Range
Dim rIndex As Long
Dim strName As String
Set wsReq = ActiveSheet
Set wsSch = Sheets("Only to be seen by Admin")
With wsReq
If Trim(.Range("C7").Value) = vbNullString Then
.Range("C7:D8").Select
MsgBox "No employee code provided.", , "Shift Request Error"
Exit Sub
End If
wsSch.unprotect "international"
Set rngFindName = wsSch.Columns("C").Find(.Range("C7").Value, , , xlWhole)
If Not rngFindName Is Nothing Then
rIndex = rngFindName.Row
strName = Trim(.Range("I6").Value)
If strName = vbNullString Then strName = "(-)"
wsSch.Cells(rIndex, Columns.Count).End(xlToLeft).Offset(, 1).Resize(, 6).Value = _
Array(.Range("C10").Text, .Range("F10").Text, .Range("C16").Value, .Range("C19").Value, strName, .Range("C23").Value)
.Range("C4:E5,C7:D8,C10:D11,C13:D14,C16:D17,C19:D20,C23:L26,F10:G11,I6:K7,J10:K11,J14:K15").ClearCon tents
.Range("C4:E5").Select
Else
.Range("C7:D8").Select
MsgBox "Employee Code [" & .Range("C7").Value & "] not found.", , "Shift Request Error"
End If
wsSch.protect "international"
End With
End Sub
Regards
Theo
Bookmarks