Re: Determine which button was clicked on a sheet



Hi XP,

Just to add, having assigned this macro to each button of interest, clicking
the button will return a message comprising the button's name.


---
Regards,
Norman



"Norman Jones" <normanjones@xxxxxxxxxxxxxxxxxxx> wrote in message
news:uSays%23AMHHA.1280@xxxxxxxxxxxxxxxxxxxxxxx
Hi XP,

Try something like:

'=============>>
Public Sub Tester()
MsgBox Application.Caller
End Sub
'<<=============



---
Regards,
Norman



"XP" <XP@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:CAEB7DC0-998C-4836-B659-5E0750EBE30C@xxxxxxxxxxxxxxxx
I have several regular buttons (i.e. not an activeX button) control on a
sheet. All of these buttons run the same user form, but I want the
results
placed into separate cells depending upon which button was clicked to
load
the form.

Using VBA, can someone please post example code that determines which
button
was clicked on the sheet, using the button's caption as the defining
variable?

Thanks in advance.




.



Relevant Pages

  • Re: Determine which button was clicked on a sheet
    ... Public Sub Tester() ... All of these buttons run the same user form, ... placed into separate cells depending upon which button was clicked to load ... was clicked on the sheet, using the button's caption as the defining ...
    (microsoft.public.excel.programming)
  • Re: Saving Input on User Form to Hidden Worksheet
    ... User form is opened and 3 Workbooks open from the User Form ... Data Saved in a Hidden Sheet in the "Spec" Work Book. ... My suggestion to use the workbook containing the form was based on your ...
    (microsoft.public.excel.programming)
  • Re: Saving Input on User Form to Hidden Worksheet
    ... User form is opened and 3 Workbooks open from the User Form ... Data Saved in a Hidden Sheet in the "Spec" Work Book. ... My suggestion to use the workbook containing the form was based on your ...
    (microsoft.public.excel.programming)
  • Re: Chip Pearson Compare add-in question
    ... I've changed my Form call macro, ... I called directly to the public sub Compare(). ... try to access it I get an error message stating it's not there. ... This is my fourth of fifth user form, so I am familiar with them. ...
    (microsoft.public.excel.programming)
  • Re: Saving Input on User Form to Hidden Worksheet
    ... User form is opened and 3 Workbooks open from the User Form ... Data Saved in a Hidden Sheet in the "Spec" Work Book. ... My suggestion to use the workbook containing the form was based on your ...
    (microsoft.public.excel.programming)