R
Richard
The following is my code for a macro I want to run on a protected worksheet.
My intent is for the macro to first unprotect the worksheet, then insert a
copy of the person's scanned signature on to the worksheet after they answer
the question "Are you sure you want to sign your timecard?", and then
reprotect the worksheet. When the code runs, I'm getting an error message
"Compile error: Expected End Sub". I'm sure it's due to a mistake (or more
than one) I've made. If anyone has time, would you please help me locate my
error(s)?
Thanks and have a wonderful holiday season!
Sub KSmith_signature()
'
' KSmith_signature Macro
' Macro recorded 12/24/2007 by Richard
'
'
Worksheets(SMITH.XLS).Unprotect Password:="simple"
Sub AskAndDo()
If MsgBox("Are you sure you want to sign your timecard?", vbYesNo +
vbQuestion) = vbNo Then Exit Sub
Else
Sheets("Sheet3").Select
ActiveSheet.Shapes("Picture 2").Select
Selection.Copy
Sheets("Master").Select
Range("A32:I34").Select
ActiveSheet.Paste
Selection.ShapeRange.IncrementLeft 54.75
Range("I26").Select
End If
End Sub
Worksheets(BEARDSLEE.XLS).Protect Password:="simple"
End Sub
My intent is for the macro to first unprotect the worksheet, then insert a
copy of the person's scanned signature on to the worksheet after they answer
the question "Are you sure you want to sign your timecard?", and then
reprotect the worksheet. When the code runs, I'm getting an error message
"Compile error: Expected End Sub". I'm sure it's due to a mistake (or more
than one) I've made. If anyone has time, would you please help me locate my
error(s)?
Thanks and have a wonderful holiday season!
Sub KSmith_signature()
'
' KSmith_signature Macro
' Macro recorded 12/24/2007 by Richard
'
'
Worksheets(SMITH.XLS).Unprotect Password:="simple"
Sub AskAndDo()
If MsgBox("Are you sure you want to sign your timecard?", vbYesNo +
vbQuestion) = vbNo Then Exit Sub
Else
Sheets("Sheet3").Select
ActiveSheet.Shapes("Picture 2").Select
Selection.Copy
Sheets("Master").Select
Range("A32:I34").Select
ActiveSheet.Paste
Selection.ShapeRange.IncrementLeft 54.75
Range("I26").Select
End If
End Sub
Worksheets(BEARDSLEE.XLS).Protect Password:="simple"
End Sub