Require checkbox to be checked before processing

S

SuperJas

Hi

I have a simple userform with 3 checkboxes, and I require that at least one checkbox has been checked. If this condition isn't met, then I'll show a message box to instruct this

My question is: How can I suspend the macro from processing the next line until this condition is met? (ie. After the user clicks OK on the msgbox, I'd like the userform to remain there so they can check the checkbox(es), and then click the "Run" button on the userform to resume the macro

My current code is as below

----------------------------------------------------
Private Sub cmdRun_Click(

If chk1 or chk2 or chk3 Then
Unload Me
DoEvent
<other code here...

Els

MsgBox "Please check at least one box", vbOKOnly + vbApplicationModal + vbCritical, "Selection Required

End I

End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top