Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Conditional Macro execution based on a variable

I want to assign multiple macros to a toolbar "button" and execute the right
macro based on a DropDown list's selection: ie-

Press "button"
examine value from dropdown list
choose the correct macro
execute
-----------------------------------------
I have the (4) macros written and working (via recorder) and could assign
them to separate "buttons" but I know there is a more professional way to do
this...

Thanks,
KG-
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Conditional Macro execution based on a variable

Use Select/Case

Sub Macro()

Select Case Range("B1")
Case "a"
Run "macro1"
Case "b"
Run "macro2"
Case "c"
Run "macro3"
End Select

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"KG Old Wolf" wrote:

I want to assign multiple macros to a toolbar "button" and execute the right
macro based on a DropDown list's selection: ie-

Press "button"
examine value from dropdown list
choose the correct macro
execute
-----------------------------------------
I have the (4) macros written and working (via recorder) and could assign
them to separate "buttons" but I know there is a more professional way to do
this...

Thanks,
KG-

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Conditional Macro execution based on a variable

OUTSTANDING! and thank you very much.

As you can tell, I am just beginning to go beyond the macro recorder for
purposes of automating certain functions within the spreadsheet.....

Again, thank you
KG-

------------------------------------------------------------------

"Jacob Skaria" wrote:

Use Select/Case

Sub Macro()

Select Case Range("B1")
Case "a"
Run "macro1"
Case "b"
Run "macro2"
Case "c"
Run "macro3"
End Select

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"KG Old Wolf" wrote:

I want to assign multiple macros to a toolbar "button" and execute the right
macro based on a DropDown list's selection: ie-

Press "button"
examine value from dropdown list
choose the correct macro
execute
-----------------------------------------
I have the (4) macros written and working (via recorder) and could assign
them to separate "buttons" but I know there is a more professional way to do
this...

Thanks,
KG-

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Conditional Macro execution based on a variable

Great..and thanks for the feedback..

If this post helps click Yes
---------------
Jacob Skaria


"KG Old Wolf" wrote:

OUTSTANDING! and thank you very much.

As you can tell, I am just beginning to go beyond the macro recorder for
purposes of automating certain functions within the spreadsheet.....

Again, thank you
KG-

------------------------------------------------------------------

"Jacob Skaria" wrote:

Use Select/Case

Sub Macro()

Select Case Range("B1")
Case "a"
Run "macro1"
Case "b"
Run "macro2"
Case "c"
Run "macro3"
End Select

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"KG Old Wolf" wrote:

I want to assign multiple macros to a toolbar "button" and execute the right
macro based on a DropDown list's selection: ie-

Press "button"
examine value from dropdown list
choose the correct macro
execute
-----------------------------------------
I have the (4) macros written and working (via recorder) and could assign
them to separate "buttons" but I know there is a more professional way to do
this...

Thanks,
KG-

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
Variable Execution speed of VBA Code SlipSleepy Excel Programming 1 November 24th 06 06:43 AM
stopping a macro based on a conditional Craig[_24_] Excel Programming 2 May 9th 06 12:30 AM
Conditional execution raja Excel Programming 7 September 20th 05 08:25 PM
Is it possible to choose a macro based upon a valve of a variable?? Rob947[_2_] Excel Programming 2 May 31st 05 05:30 PM
Conditional macro execution Willis Marsh Excel Programming 4 April 28th 04 05:02 AM


All times are GMT +1. The time now is 02:09 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"