Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default FUNCTION TO CALL NAME OF SELF (BUTTON)

What I am trying to find, is a function in a macro that
will call the name of itself. I will attach the macro to
the button and want it to get the name of the button that
fired it. Can anyone help me on how to do that?! Really
need to know, thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default FUNCTION TO CALL NAME OF SELF (BUTTON)

If it is a toolbar button, you can get it with


MsgBox CommandBars.ActionControl.Caption

--

HTH

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

"Wandering Mage" wrote in message
...
What I am trying to find, is a function in a macro that
will call the name of itself. I will attach the macro to
the button and want it to get the name of the button that
fired it. Can anyone help me on how to do that?! Really
need to know, thank you!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default FUNCTION TO CALL NAME OF SELF (BUTTON)

There are buttons, buttons, buttons and other buttons. But if you're able to
assign macros to them then
Application.Caller
is often pretty useful.

HTH. Best wishes Harald

"Wandering Mage" skrev i melding
...
What I am trying to find, is a function in a macro that
will call the name of itself. I will attach the macro to
the button and want it to get the name of the button that
fired it. Can anyone help me on how to do that?! Really
need to know, thank you!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default FUNCTION TO CALL NAME OF SELF (BUTTON)

It is a button created from the FORMS toolbar. I tried
that funcion but it failed. "Object variable or With
block variable not set". I basically need the name of the
button so that I can have one macro for many buttons. It
will get the name of itself, which is actually a cell
("C3", "C4", etc.). Then it will use its name to toggle
the cell value with its name (Range(name).Value = "X"). I
cannot seem to find how to call out the activated buttons
name, however. Thanks.


-----Original Message-----
If it is a toolbar button, you can get it with


MsgBox CommandBars.ActionControl.Caption

--

HTH

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

"Wandering Mage"

wrote in message
...
What I am trying to find, is a function in a macro that
will call the name of itself. I will attach the macro

to
the button and want it to get the name of the button

that
fired it. Can anyone help me on how to do that?!

Really
need to know, thank you!



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default FUNCTION TO CALL NAME OF SELF (BUTTON)

1000 thanks! Just what the doctor ordered. Saved me a
HUGE amount of back tracking, in the event that I could
not find a function to do this. Thank You!
-----Original Message-----
There are buttons, buttons, buttons and other buttons.

But if you're able to
assign macros to them then
Application.Caller
is often pretty useful.

HTH. Best wishes Harald

"Wandering Mage"

skrev i melding
...
What I am trying to find, is a function in a macro that
will call the name of itself. I will attach the macro

to
the button and want it to get the name of the button

that
fired it. Can anyone help me on how to do that?!

Really
need to know, thank you!



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default FUNCTION TO CALL NAME OF SELF (BUTTON)

"Wandering Mage" skrev i melding
...
1000 thanks! Just what the doctor ordered. Saved me a
HUGE amount of back tracking, in the event that I could
not find a function to do this. Thank You!


You're welcome, glad it worked. Thank you for the feedback, much
appreciated.

Best wishes Harald


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I call IE browser (Back button) through Excel macro? SAM SEBAIHI Excel Discussion (Misc queries) 0 December 14th 06 12:49 AM
How can I call IE browser (Back button) through Excel macro? SAM SEBAIHI Excel Discussion (Misc queries) 0 December 13th 06 04:50 AM
Button fails to call macro when open an Excel via Intranet tigertax Excel Discussion (Misc queries) 1 April 12th 05 10:21 AM
Button won't call macro Lift Off Excel Programming 6 April 13th 04 10:44 PM
button to call website Andrew Harder Excel Programming 2 November 25th 03 02:27 PM


All times are GMT +1. The time now is 03:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"