Conditional Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro which is assigned to a control box or button. However I do not
want the macro to run if a value is entered in another cell in the worksheet.
Eg

if Cell A1 has a drop down list and if "Apply Mannually" is chosen then the
macro should not run if teh user accidentally presses the control box button

How can I do this
 
Private Sub commandButton1_Click()
if Range("A1").Value = "Apply Manually" then exit sub

' current code

End Sub
 

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

Back
Top