Hi All, Hi tigeravatar
Below is the code of one of the macros, the problem is it does now work when the work sheet is passowrd protected?? can somebody help? Password to unlock the sheet is "international". I want the macro to open the sheet paste the details and then again lock the sheet...somebody please help?
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
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").ClearContents
.Range("C4:E5").Select
Else
.Range("C7:D8").Select
MsgBox "Employee Code [" & .Range("C7").Value & "] not found.", , "Shift Request Error"
End If
End With
End Sub
cheers and thanks
Bookmarks