View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default if condition on a hot button

By 'hot button' I assume you mean a button on a toolbar that you have added,
manually or programmatically, and assigned it to a macro

Assign your buttons to your Macro

Sub myMacro
Dim sCaller as string

sCaller = Commandbars.ActionControl.Caption
' sCaller = Commandbars.ActionControl.Tag
' sCaller = Commandbars.ActionControl.Parameter

Select Case sCaller
Case "hot but #1"
'etc

If you programmatically added the buttons you could assign the Tag and/or
Parameter properties.

It's probably better not to use Goto within a select case, lots of other
ways.

Regards,
Peter T

"jaclh2o" wrote in message
...
What are the detail commands to execute a sub routine within same module
based on one selection from a list of hot bottons.
I imagine something like...

if <<hot bottom #1 selected go to line #XX
--
Thanks