Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Storing a Macro name in a Variable

Is there a way to store the name of a macro (with or
without parameters) in a named variable and then activate
the macro using the variable reference name?

Thanks,

Jack

This doesn't work but is waht I am trying to accomplish

Dim xMacro
xMarco = "ApplicationName"

Application. run ApplicationName

Likewise for a macro with parameters
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Storing a Macro name in a Variable

Jack,
If it's a VBA procedure, try Call xyz(). If it has
parameters try Call xyz(prm1, prm2). Or do you really want
to run Excel 4 mactos?
Geof.
-----Original Message-----
Is there a way to store the name of a macro (with or
without parameters) in a named variable and then activate
the macro using the variable reference name?

Thanks,

Jack

This doesn't work but is waht I am trying to accomplish

Dim xMacro
xMarco = "ApplicationName"

Application. run ApplicationName

Likewise for a macro with parameters
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Storing a Macro name in a Variable

Dim xMacro
xMacro = "ApplicationName"

Application.run xMacro


Sub Macro1(x, y)
MsgBox x & " " & y
End Sub

Sub Macro2()
Dim xMacro
xMacro = "Macro1"
Application.Run xMacro, "StringArg1", 29
End Sub

--
Regards,
Tom Ogilvy


"Jack Adams" wrote in message
...
Is there a way to store the name of a macro (with or
without parameters) in a named variable and then activate
the macro using the variable reference name?

Thanks,

Jack

This doesn't work but is waht I am trying to accomplish

Dim xMacro
xMarco = "ApplicationName"

Application. run ApplicationName

Likewise for a macro with parameters



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
Storing textin a variable and comparing to a second value Ron Excel Discussion (Misc queries) 3 May 13th 09 08:26 PM
Storing a range variable in a cell Dreaded404 Excel Discussion (Misc queries) 1 July 2nd 08 03:37 PM
Storing a value to variable CLamar Excel Discussion (Misc queries) 0 June 16th 06 04:46 PM
Excel VBA - Storing text in a variable, and "'Cells' of object _Global failed" engineer[_2_] Excel Programming 3 April 23rd 04 11:35 PM
storing numbers within the macro Chris Excel Programming 0 October 27th 03 06:04 PM


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