Hi,
I need a little help to prevent save and show a message if two checkbox values are both false in a workbook.
Currently, I am getting the error below referencing this line in the macro:
CheckBox1.Value = False And CheckBox2.Value = False Then
run-time error '424':
Object required
Any Help is appreciated.
Thanks,
AEM
Here is a sample of the code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
I need a little help to prevent save and show a message if two checkbox values are both false in a workbook.
Currently, I am getting the error below referencing this line in the macro:
CheckBox1.Value = False And CheckBox2.Value = False Then
run-time error '424':
Object required
Any Help is appreciated.
Thanks,
AEM
Here is a sample of the code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If CheckBox1.Value = False And CheckBox2.Value = False Then
End SubCancel = True
MsgBox "You must check one of the boxes"
End IfMsgBox "You must check one of the boxes"