Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My Location

Status
Not open for further replies.

aw23

Programmer
Nov 26, 2003
544
IL
Is there any method to allow me to know what form I'm in and what sub or function I'm in?

If I want to write to the debugger that I am in formA function myFunction, is there a way?
is there a way for a module too?
Thanks
 
Hi aw23,

There's no way to know what Sub or Function (or Module) you are in except by hard coding the names yourself.
It might be possible in some circumstances to know what UserForm (by using Me.Name) you are in.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Thanks, I hardcoded it, it took a little longer but no big deal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top