ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro quesetion (https://www.excelbanter.com/excel-discussion-misc-queries/60568-macro-quesetion.html)

Mike F.

Macro quesetion
 
Is there a way to have a macro run based on the condition of a cell or a
toggle button? Examlpe, if Type = Local then the macros on sheet 2 that are
needed for long estiamtes will automatically run.

Dave Peterson

Macro quesetion
 
I'm not sure what you're asking, but if that cell changes by typing, you could
use a worksheet_change event to fire the other macros.

If you want to read more about these kinds of events:

Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

If you meant you wanted to check in your macro for the value in that cell...

if lcase(worksheets("Sheet1").range("a1").value) = "local" then
'do one thing
else
'do a different thing
end if



Mike F. wrote:

Is there a way to have a macro run based on the condition of a cell or a
toggle button? Examlpe, if Type = Local then the macros on sheet 2 that are
needed for long estiamtes will automatically run.


--

Dave Peterson


All times are GMT +1. The time now is 11:36 PM.

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