Coupled controls?

R

Ruatha

Hi, I have a button assciated with a macro, but I want to make sure tha
the button isn't pressed by mistake.
So I was thinking of having a checkbox, that when checked enables th
command button, and when unchecked the button is disabled.
How do I do that
 
D

Dave Peterson

I think I'd just add a bit to the macro that is associated with the button.

Option explicit
sub yoursubhere()

dim resp as long

resp = msgbox(Prompt:="Are you sure you want to do all this stuff", _
buttons:=vbyesno)

if resp = vbno then
exit sub
end if

'rest of your code here
 

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