ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro run order (https://www.excelbanter.com/excel-programming/281561-macro-run-order.html)

Rui[_2_]

Macro run order
 
hi,

is there a way of setting some order in macros?

for instance, i don't want macro2 and 3 to run if
macro1 hasn't.

thank's.

John Wilson

Macro run order
 
Rui,

One way....
Set a Public variable within Macro1.

Public ItRan as Boolean
Sub Macro1()
ItRan = True
' your code
End Sub

Sub Macro2()
If ItRan = False Then Exit Sub
' your code
End Sub

John

Rui wrote:

hi,

is there a way of setting some order in macros?

for instance, i don't want macro2 and 3 to run if
macro1 hasn't.

thank's.




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

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