ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Macro (https://www.excelbanter.com/excel-programming/373919-conditional-macro.html)

Kav

Conditional Macro
 
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
--
Kav

Tom Ogilvy

Conditional Macro
 
Private Sub commandButton1_Click()
if Range("A1").Value = "Apply Manually" then exit sub

' current code

End Sub

--
Regards,
Tom Ogilvy


"Kav" wrote:

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
--
Kav



All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com