PC Review


Reply
 
 
fi.or.jp.de
Guest
Posts: n/a
 
      5th May 2010
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
 
Reply With Quote
 
 
 
 
Chip Pearson
Guest
Posts: n/a
 
      5th May 2010
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"
<(E-Mail Removed)> 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

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      5th May 2010
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
(E-Mail Removed)
"fi.or.jp.de" <(E-Mail Removed)> wrote in message
news:4498dc64-d79c-442f-8eea-(E-Mail Removed)...
> 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


 
Reply With Quote
 
fi.or.jp.de
Guest
Posts: n/a
 
      6th May 2010
Thanks Don & Chip Pearson

It works great


On May 6, 3:40*am, "Don Guillett" <dguille...@gmail.com> 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
> dguill...@gmail.com"fi.or.jp.de" <fi.or.jp...@gmail.com> wrote in message
>
> news:4498dc64-d79c-442f-8eea-(E-Mail Removed)...
>
>
>
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
call to macro in xlam from macro in xlsb SteveDB1 Microsoft Excel Programming 1 2nd Jul 2008 11:55 PM
Call an Access macro from an Excel macro Jason W Microsoft Excel Misc 1 1st May 2008 08:33 PM
Re: Excel Macro call Word Macro with Parameters =?Utf-8?B?Q3VydA==?= Microsoft Excel Programming 0 24th May 2007 12:21 AM
Call macro stored in Excel workbook from Outlook's macro =?Utf-8?B?R3ZhcmFt?= Microsoft Excel Programming 0 4th Oct 2006 05:47 PM
Call macro stored in Excel workbook from Outlook's macro =?Utf-8?B?R3ZhcmFt?= Microsoft Outlook VBA Programming 5 4th Oct 2006 06:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:04 PM.