+ Reply to Thread
Results 1 to 6 of 6

VB Code to run macro from cell

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to run macro from cell

    Hello:
    Please refer to attached file.

    I will be selecting the name of the macro from dropdown list in cell A1.
    I need VB Code to run the macro named in cell A1.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: VB Code to run macro from cell

    Hey Riz,

    Find the attached that does what I think you want.

    RunMacro Select Case.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to run macro from cell

    Hello MarvinP:

    Thanks and this will be helpful.
    However, my requirement is little different.

    I may not have drop down list.

    Basically i need to use Application.Run command with cell address.

    For example:

    If i need to run "My Work Book.xls'!Macro2" the text is in cell E2, i need VB code:

    Application.Run Range("E2").Value, not user if this command would work.

    So i will have full data of macros and depending on which one i need to run, i can define by its location

    I hope this make sense.
    So need correct code how to use Application.Run with cell reference.

    Please let me know if you have any questions.
    Thanks.

    R

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: VB Code to run macro from cell

    I was just reading about that at:

    https://stackoverflow.com/questions/...h-a-string-vba

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to run macro from cell

    Hello Marvin:

    Yes this article will help.
    I will try and let you know if any more questions
    Thanks a lot
    Tiz

  6. #6
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to run macro from cell

    Hello Marvin:

    Thanks a lot, above article was good and was able to implement and resolve my problem.
    May be i will need further help as i complete my project.
    Thanks
    Riz

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-16-2017, 06:49 AM
  2. Macro code where a cell freezes on the basis of values in other cell
    By vikash200418 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2014, 02:55 PM
  3. Macro code to call a macro if a certain cell's value is change
    By mm671750 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-05-2014, 12:37 PM
  4. [SOLVED] Macro code required: if cell = S*(wildcard) then copy from one cell to another
    By 11linc11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2013, 09:13 PM
  5. [SOLVED] Macro to copy over cell value rather than actual cell (code included)
    By jayinthe813 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2012, 11:55 AM
  6. i need a macro code to compare time in two cells cell A and cell b
    By kshitij_dch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-31-2012, 06:52 AM
  7. macro code for adding a cell in left of original cell?
    By gkeith in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-29-2010, 03:30 PM

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