Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if condition on a hot button

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if condition on a hot button

I mean a hot spot in the spreadsheet itself not on the tool bar, would your
proposal work the same?
--
Thanks


"Peter T" wrote:

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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default if condition on a hot button

Define what you mean by a "hot spot in the spreadsheet", eg cell (select or
double click), a Forms or ActiveX control.

Regards,
Peter T


"jaclh2o" wrote in message
...
I mean a hot spot in the spreadsheet itself not on the tool bar, would

your
proposal work the same?
--
Thanks


"Peter T" wrote:

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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if condition on a hot button

This is an object (Box with Text) with an assigned macro

Thanks


"Peter T" wrote:

Define what you mean by a "hot spot in the spreadsheet", eg cell (select or
double click), a Forms or ActiveX control.

Regards,
Peter T


"jaclh2o" wrote in message
...
I mean a hot spot in the spreadsheet itself not on the tool bar, would

your
proposal work the same?
--
Thanks


"Peter T" wrote:

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








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default if condition on a hot button

With Shapes from the Drawing toolbar, eg a Textbox, and controls from the
Forms Toolbar you can do this, (also refer to my previous example)

sCaller = Application.Caller

this returns the name of the Shape, eg "Text Box 1"

Regards,
Peter T

"jaclh2o" wrote in message
...
This is an object (Box with Text) with an assigned macro

Thanks


"Peter T" wrote:

Define what you mean by a "hot spot in the spreadsheet", eg cell (select

or
double click), a Forms or ActiveX control.

Regards,
Peter T


"jaclh2o" wrote in message
...
I mean a hot spot in the spreadsheet itself not on the tool bar, would

your
proposal work the same?
--
Thanks


"Peter T" wrote:

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








  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default if condition on a hot button

It wasn't easy to get the first one to work but i finally got it.
--
Thanks


"Peter T" wrote:

With Shapes from the Drawing toolbar, eg a Textbox, and controls from the
Forms Toolbar you can do this, (also refer to my previous example)

sCaller = Application.Caller

this returns the name of the Shape, eg "Text Box 1"

Regards,
Peter T

"jaclh2o" wrote in message
...
This is an object (Box with Text) with an assigned macro

Thanks


"Peter T" wrote:

Define what you mean by a "hot spot in the spreadsheet", eg cell (select

or
double click), a Forms or ActiveX control.

Regards,
Peter T


"jaclh2o" wrote in message
...
I mean a hot spot in the spreadsheet itself not on the tool bar, would
your
proposal work the same?
--
Thanks


"Peter T" wrote:

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









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
Deactivating a Forms macro button based on a worksheet condition? Ace70 Excel Discussion (Misc queries) 3 June 10th 07 10:31 PM
Button on condition Ricky Pang Excel Programming 1 May 4th 06 09:09 AM
How do I hide a command button based on a condition? [email protected] Excel Programming 4 May 3rd 06 02:47 PM
Set condition of button on click Robb Quirk Excel Programming 2 February 14th 06 07:18 PM
activate/deactivate button with macro at given condition arcq Excel Programming 1 March 17th 05 05:35 AM


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

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

About Us

"It's about Microsoft Excel"