+ Reply to Thread
Results 1 to 6 of 6

Calling a macro inside another macro

  1. #1
    Registered User
    Join Date
    01-05-2015
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    11

    Calling a macro inside another macro

    I have successfully run multiple macros in separate sub routines but I am now trying to run a macro (in the same workbook) at the end of another macro with code.

    here is an abridged version of the code

    Please Login or Register  to view this content.
    Can someone advise what I am doing wrong with the last command to Call the other macro. I tried AplicationRun but that didn't work.

    Any assistance is greatly appreciated.

    Mike

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Calling a macro inside another macro

    The syntax is correct assuming the other macro takes no parameters and is correctly scoped. What happens when you run this?
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Calling a macro inside another macro

    Where is Other_macro located and how is it declared?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    01-05-2015
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    11

    Re: Calling a macro inside another macro

    Thank you for the quick replies
    To answer both questions ...

    I receive a compile error
    Expected Variable or procedure, not module

    But when I check the second Macro it works and appears ok

    here is the actual end of the main macro - you will see the actual "call" in the second last line

    Please Login or Register  to view this content.
    here is the start of the macro that was being called

    Please Login or Register  to view this content.
    Not sure if posting this note helps
    As always, I appreciate any help or advice

    Mike
    Last edited by MikeMeerkat; 01-14-2015 at 07:19 PM.

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Calling a macro inside another macro

    Did you give the module and macro the same name? If so, change the module name.

  6. #6
    Registered User
    Join Date
    01-05-2015
    Location
    Melbourne
    MS-Off Ver
    2010
    Posts
    11

    Re: Calling a macro inside another macro

    Dear romperstomper

    what a champion - I don't know why it works but it worked!
    Thanks so much.

    As we say in Melbourne - 3 votes (best on ground)

    Mike

+ 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: 3
    Last Post: 01-07-2015, 12:19 PM
  2. [SOLVED] Is it mandatory to keep the excel file as macro enable (if inside having macro) ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-09-2014, 11:39 PM
  3. Calling macro 10 times, add header list to macro call only once
    By capson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2013, 09:42 AM
  4. [SOLVED] Calling a macro from an event macro. Using nest loops with if statements
    By c0d3crunch3r in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-12-2012, 08:31 AM
  5. Button command doesnt work while calling a macro from a macro
    By bryan444 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-06-2012, 09:39 AM

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