View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default identify first macro run

Maybe you could use a hidden worksheet that can be populated with the name of
the macro.

Clear the range first (if you want), then each macro would write its name in the
next available cell.

Option Explicit
Sub Auto_Open()
with worksheets("HiddenSheetNameHere")
.cells.clear
.range("a1").value = "Order of Macs"
end with
End sub

Then each macro would have something like:

with worksheets("HiddenSheetNameHere")
.cells(.rows.count,"A").end(xlup).offset(1,0).valu e _
"NameOfThisMacro"
end with

And you could inspect that whenever you wanted.

sunilpatel wrote:

when someone using my workbook runs one of my 5 macros using
"tools-macro-macro-run...." Depending on which one is started, a different
order of macros are run. Hence i need to capture the name of the first macro
that was run by the user. Is this possible?


--

Dave Peterson