ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Address Subroutine Name from within Sub (https://www.excelbanter.com/excel-programming/290895-address-subroutine-name-within-sub.html)

Al[_10_]

Address Subroutine Name from within Sub
 
Hi folks,

Is there any way to refer to a subroutines name from within the
subroutine itself in the same way that you can have:

ActiveWorkbook.Name

Thanks,
Al

Bob Phillips[_6_]

Address Subroutine Name from within Sub
 
Al,

I don't think that there is any way that you can get this information from
the system, VBA, or Excel.

To get what you want, I think you would have to manage it all yourself.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Al" wrote in message
om...
Hi folks,

Is there any way to refer to a subroutines name from within the
subroutine itself in the same way that you can have:

ActiveWorkbook.Name

Thanks,
Al




jaf

Address Subroutine Name from within Sub
 
Why would you ever need to?

sub test()
test 'recursive call
if a<"" then test 'ditto
end sub


--
John
johnf 202 at hotmail dot com


"Al" wrote in message
om...
| Hi folks,
|
| Is there any way to refer to a subroutines name from within the
| subroutine itself in the same way that you can have:
|
| ActiveWorkbook.Name
|
| Thanks,
| Al



onedaywhen

Address Subroutine Name from within Sub
 
If you called the sub using the CallByName function, you could pass
the name of the sub as an arguement. I too have no idea why you'd want
to do this, but then I've never found a legitimate use of CallByName.

--

"jaf" wrote in message ...
Why would you ever need to?

sub test()
test 'recursive call
if a<"" then test 'ditto
end sub


--
John
johnf 202 at hotmail dot com


"Al" wrote in message
om...
| Hi folks,
|
| Is there any way to refer to a subroutines name from within the
| subroutine itself in the same way that you can have:
|
| ActiveWorkbook.Name
|
| Thanks,
| Al



All times are GMT +1. The time now is 05:32 PM.

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