#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default 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 -


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
How can run a macro ( call a macro) on selection of any filtercriteria? [email protected] Excel Worksheet Functions 7 February 20th 09 12:34 AM
call to macro in xlam from macro in xlsb SteveDB1 Excel Programming 1 July 2nd 08 11:55 PM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Excel Macro call Word Macro with Parameters Bill Sturdevant[_2_] Excel Programming 9 May 24th 07 12:21 AM
Call macro stored in Excel workbook from Outlook's macro Gvaram Excel Programming 0 October 4th 06 05:47 PM


All times are GMT +1. The time now is 09:36 AM.

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"