From: fi.or.jp.de on 5 May 2010 18:25 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
From: Chip Pearson on 5 May 2010 18:33 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" <fi.or.jp.de(a)gmail.com> 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
From: Don Guillett on 5 May 2010 18:40 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 dguillett(a)gmail.com "fi.or.jp.de" <fi.or.jp.de(a)gmail.com> wrote in message news:4498dc64-d79c-442f-8eea-65d440425cdc(a)37g2000yqm.googlegroups.com... > 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
From: fi.or.jp.de on 6 May 2010 06:19 Thanks Don & Chip Pearson It works great On May 6, 3:40 am, "Don Guillett" <dguille...(a)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...(a)gmail.com"fi.or.jp.de" <fi.or.jp...(a)gmail.com> wrote in message > > news:4498dc64-d79c-442f-8eea-65d440425cdc(a)37g2000yqm.googlegroups.com... > > > > > 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 -
|
Pages: 1 Prev: Create employee attendance db using personal.xls? Next: VBA used to resize objects? |