View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jan Karel Pieterse Jan Karel Pieterse is offline
external usenet poster
 
Posts: 535
Default identifying caller procedure

Hi Stefi,

Is there any feature in VBA for identifying a caller procedure? E.g. if Sub
C is called from Sub A and Sub B, i'd like to know in Sub C that it was
called from Sub A or Sub B.


One way would be bt using an argument:

Sub A(sCaller as String)
Msgbox "I was called by: " & sCaller
End Sub

Sub B()
A "Sub B"
End Sub

Sub C()
A "Sub C"
End Sub

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com