ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Call Macro (https://www.excelbanter.com/excel-programming/442336-call-macro.html)

fi.or.jp.de

Call Macro
 
Hi All,

I have one main macro,

I have to call another macro like this

if Cells(1,"A").value = "AUSTRALIA" then Call Main_AUSTRALIA
if Cells(1,"A").value = "UNITED STATES" then Call Main_UNITED STATES

similarly there are 40 macros need to call.

Can i code like this

if Cells(1,"A").value < "" then Call Main_& cells(1,"A").value

thanks in advance

Chip Pearson

Call Macro
 
You can use Application.Run to do this. E.g.,

Application.Run "Main_" & Cells(1,"A").Value

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Wed, 5 May 2010 15:25:08 -0700 (PDT), "fi.or.jp.de"
wrote:

Hi All,

I have one main macro,

I have to call another macro like this

if Cells(1,"A").value = "AUSTRALIA" then Call Main_AUSTRALIA
if Cells(1,"A").value = "UNITED STATES" then Call Main_UNITED STATES

similarly there are 40 macros need to call.

Can i code like this

if Cells(1,"A").value < "" then Call Main_& cells(1,"A").value

thanks in advance


Don Guillett[_2_]

Call Macro
 
try it this way

Sub calla1()
On Error Resume Next
Application.Run "Main_" & Cells(1, "a")
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"fi.or.jp.de" wrote in message
...
Hi All,

I have one main macro,

I have to call another macro like this

if Cells(1,"A").value = "AUSTRALIA" then Call Main_AUSTRALIA
if Cells(1,"A").value = "UNITED STATES" then Call Main_UNITED STATES

similarly there are 40 macros need to call.

Can i code like this

if Cells(1,"A").value < "" then Call Main_& cells(1,"A").value

thanks in advance



fi.or.jp.de

Call Macro
 
Thanks Don & Chip Pearson

It works great


On May 6, 3:40*am, "Don Guillett" wrote:
try it this way

Sub calla1()
On Error Resume Next
Application.Run "Main_" & Cells(1, "a")
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
" wrote in message

...



Hi All,


I have one main macro,


I have to call another macro like this


if Cells(1,"A").value = "AUSTRALIA" then Call Main_AUSTRALIA
if Cells(1,"A").value = "UNITED STATES" then Call Main_UNITED STATES


similarly there are 40 macros need to call.


Can i code like this


if Cells(1,"A").value < "" then Call Main_& cells(1,"A").value


thanks in advance- Hide quoted text -


- Show quoted text -




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com