Hi there,
I have a form (not a userform but an excel spreadsheet for work) which contains 13 checkboxes. I need ALL checkboxes to be checked before the button sends me the e-mail. I have the working code for the e-mail but I can't seem to get the code right for the checkboxes.
Basically, I need code to do this :
1) Check if ALL checkboxes are checked.
2) If not, MsgBox telling the user to check all of them and stop the Loop.
3) If all boxes are checked, do this action.
Right now I got :
Sub BoxCheck()
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.CheckBox And obj.Object.Value = True Then
Mail_ActiveSheet
Else
MsgBox ("Please make sure to check all boxes before sending the file")
End If
Next
End Sub
But I can't seem to get a loop going and right now it sends me an email for each checkbox that is checked and opens a msgbox for each box that isn't checked.
Any ideas ?
I have a form (not a userform but an excel spreadsheet for work) which contains 13 checkboxes. I need ALL checkboxes to be checked before the button sends me the e-mail. I have the working code for the e-mail but I can't seem to get the code right for the checkboxes.
Basically, I need code to do this :
1) Check if ALL checkboxes are checked.
2) If not, MsgBox telling the user to check all of them and stop the Loop.
3) If all boxes are checked, do this action.
Right now I got :
Sub BoxCheck()
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.CheckBox And obj.Object.Value = True Then
Mail_ActiveSheet
Else
MsgBox ("Please make sure to check all boxes before sending the file")
End If
Next
End Sub
But I can't seem to get a loop going and right now it sends me an email for each checkbox that is checked and opens a msgbox for each box that isn't checked.
Any ideas ?