Hello
, I am new to creating macros. can someone please let me know where I am going wrong. I have an excel workbook for Timesheets and have setup a macro clears all tick boxes. but would like to give the user the options of yes or no prior to running the macro.
Here is the simple code:
Sub ClearCheckBoxes()
Dim ChkBox As Object
Dim Wks As Worksheet
if MsgBox ( prompt = "Warning this will clear Timesheet Data, would you like to Continue?",
Buttons = vbYesNo + vbQuestion, _
Title = "Clear TimeSheet Data" )= vbNo then
Exit Sub
End If
For Each Wks In Worksheets
For Each ChkBox In Wks.CheckBoxes
ChkBox.Value = xlOff
Next ChkBox
Next Wks
End Sub
I get syntax error can anyone please help?
Thank you
Bookmarks