Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Buttons
Hi,
XL2003 I have some buttons on the Worksheet (from the Forms toolbar) which fire specific macros. Can VBA return (to a variable) the text of the button that fired it? Regards - Dave. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Buttons
Application.Caller will give you the name of the button.
You can get the text using the name. Tim "Dave" wrote in message ... Hi, XL2003 I have some buttons on the Worksheet (from the Forms toolbar) which fire specific macros. Can VBA return (to a variable) the text of the button that fired it? Regards - Dave. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Buttons
Hi Tim,
Thanks for your help. But still stuck. I have: A = Application.Caller B = ActiveSheet.Shapes(A).Characters.Text The first line is working. But the second line gives an error. Can you please point me to the right syntax? Regards - Dave. "Tim Williams" wrote: Application.Caller will give you the name of the button. You can get the text using the name. Tim "Dave" wrote in message ... Hi, XL2003 I have some buttons on the Worksheet (from the Forms toolbar) which fire specific macros. Can VBA return (to a variable) the text of the button that fired it? Regards - Dave. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Buttons
see if this works for you.
A = Application.Caller b = ActiveSheet.Buttons(A).Characters.Text -- jb "Dave" wrote: Hi Tim, Thanks for your help. But still stuck. I have: A = Application.Caller B = ActiveSheet.Shapes(A).Characters.Text The first line is working. But the second line gives an error. Can you please point me to the right syntax? Regards - Dave. "Tim Williams" wrote: Application.Caller will give you the name of the button. You can get the text using the name. Tim "Dave" wrote in message ... Hi, XL2003 I have some buttons on the Worksheet (from the Forms toolbar) which fire specific macros. Can VBA return (to a variable) the text of the button that fired it? Regards - Dave. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Buttons
Hi John,
Thanks! When I modified the button with the macro recorder turned on, the syntax used 'Shapes', But 'Buttons' works and Shapes doesn't, so pooh to the macro recorder, and hats of to you. Regards - Dave. "john" wrote: see if this works for you. A = Application.Caller b = ActiveSheet.Buttons(A).Characters.Text -- jb "Dave" wrote: Hi Tim, Thanks for your help. But still stuck. I have: A = Application.Caller B = ActiveSheet.Shapes(A).Characters.Text The first line is working. But the second line gives an error. Can you please point me to the right syntax? Regards - Dave. "Tim Williams" wrote: Application.Caller will give you the name of the button. You can get the text using the name. Tim "Dave" wrote in message ... Hi, XL2003 I have some buttons on the Worksheet (from the Forms toolbar) which fire specific macros. Can VBA return (to a variable) the text of the button that fired it? Regards - Dave. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Form buttons and Control Command Buttons | Excel Programming | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
Form buttons vs. ActiveX Buttons | Excel Discussion (Misc queries) | |||
have toggle buttons but everytime print preview buttons move | Excel Discussion (Misc queries) | |||
Control Buttons vs. Command Buttons | Excel Programming |