Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default executing macros with variable names

Is is possible to execute a macro with a variable in the
name e.g.

a = 1
macro&a
macro&a+1

or something similar. I have a set of macros which I want
to execute depending on some variable. I'm using the format

Case "1"
macro1
macro2
etc.
but this is getting a bit tedious

Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default executing macros with variable names

Claude,

You can use Application.Run. E.g.,

Application.Run "Macro" & A+1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Claude" wrote in message
...
Is is possible to execute a macro with a variable in the
name e.g.

a = 1
macro&a
macro&a+1

or something similar. I have a set of macros which I want
to execute depending on some variable. I'm using the format

Case "1"
macro1
macro2
etc.
but this is getting a bit tedious

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
Combine macros variable help Ephraim Excel Worksheet Functions 2 March 21st 10 01:52 PM
Dummy variable in macros BWimer Excel Discussion (Misc queries) 1 April 4th 08 09:21 PM
Macros with variable data jeannie v Excel Worksheet Functions 2 June 17th 07 10:20 PM
Executing Macros bmorganh Excel Discussion (Misc queries) 1 January 27th 06 12:03 AM
Executing of excel Macros. KarthikK Excel Discussion (Misc queries) 4 June 28th 05 12:00 PM


All times are GMT +1. The time now is 10:23 PM.

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

About Us

"It's about Microsoft Excel"