+ Reply to Thread
Results 1 to 5 of 5

Chose what Macro to Run

  1. #1
    Forum Contributor
    Join Date
    07-06-2012
    Location
    Bitola,Macedonia
    MS-Off Ver
    Excel 2007
    Posts
    132

    Chose what Macro to Run

    I have 12 Macros "Sub testSQL1()" , "Sub testSQL2()" , "Sub testSQL3()" ....

    I want When in cell C1 is January then to Run "Sub testSQL1()"
    If it is February then to Run "Sub testSQL2()"
    If it is March then to Run "Sub testSQL3()"
    ... until December

    Macro need to Run on Button

    Thank you very much

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,904

    Re: Chose what Macro to Run

    You can probably achieve this using the Case function in VBA

    Look here: http://www.techonthenet.com/excel/formulas/case.php
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Chose what Macro to Run

    try this..

    Please Login or Register  to view this content.
    Thanks!
    Raga.

    Please,mark your thread [SOLVED] if you received your answer.

    Click the little star * below, to give some Rep if you think an answer deserves it.

    I learnt so many things from these links.

  4. #4
    Forum Contributor
    Join Date
    07-06-2012
    Location
    Bitola,Macedonia
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Chose what Macro to Run

    Thank you very much,
    I am sorry I have one more question
    In C2 I have year how can i put to see that too
    So Month and Year

  5. #5
    Forum Contributor ragavan.sridar1's Avatar
    Join Date
    11-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010, Excel 2003
    Posts
    208

    Re: Chose what Macro to Run

    give this a try..

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1