+ Reply to Thread
Results 1 to 6 of 6

Running a Macro to run macros across different sheets

  1. #1
    Registered User
    Join Date
    08-11-2017
    Location
    California
    MS-Off Ver
    2010
    Posts
    3

    Running a Macro to run macros across different sheets

    I'm having difficulty with a master macro of sorts. When I step into it and go through it step by step, it works perfectly. But when running it on its own, it just stops after the first bit.

    The purpose of the macro - I have 6 different workbooks that have 1 to 16 tabs within them. Each tab corresponds to its own macro. In the workbook I have created a master macro to run all the macros within the workbook. I have been able to get these to work without issue.

    Now, I want to create my Master macro that will open each workbook and run the macro to run all the macros within. It appears to open the file asked for and then stalls. It doesn't run the macro at all. I have tried Call, Application.Run, and just about everything I've been able to find through Google. I am hoping to get the macros within the workbooks to run from the Master macro that's within my personal workbook.

    Any help would be appreciated. I'm not amazing at this but I'm generally able to piecemeal between different tutorials and the record macro to get something that works for me. Thank you.



    Master Macro within my personal workbook:


    Please Login or Register  to view this content.





    DailyInventory Macro that is within the first workbook being called in the one ring macro:


    Please Login or Register  to view this content.
    Last edited by kamylynn; 08-18-2017 at 07:47 PM.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Help Please - Running a Macro to run macros across different sheets

    Hi, welcome to the form
    take a look this post https://www.excelforum.com/excel-pro...k-macro-2.html
    This person has a master file from which the process is done.
    The attached files tell the whole story, I'm sure that by editing it to your needs you will accomplish the same.
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    08-11-2017
    Location
    California
    MS-Off Ver
    2010
    Posts
    3

    Re: Help Please - Running a Macro to run macros across different sheets

    Thank you for the welcome! And thank you for the direction. It actually allowed me to adjust my workflow and also do a button to run. And it looks like I have it working for the first three workbooks but then it just dies afterwards. I don't understand why and if you can explain why as well as assist to get it to work, I'd appreciate it. I would like to understand why it's working as well as get it to work, please.


    Please Login or Register  to view this content.
    Last edited by kamylynn; 08-18-2017 at 07:47 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: Help Please - Running a Macro to run macros across different sheets

    thank you for the code tags
    Last edited by protonLeah; 08-18-2017 at 08:28 PM.
    Ben Van Johnson

  5. #5
    Registered User
    Join Date
    08-11-2017
    Location
    California
    MS-Off Ver
    2010
    Posts
    3

    Re: Help Please - Running a Macro to run macros across different sheets

    Quote Originally Posted by protonLeah View Post
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    I'm sorry! I couldn't figure out how to get it to work with the WYSIWYG and I was so frustrated and trying to get it to work I didn't try to figure it out. I apologize. I've now fixed it.

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Running a Macro to run macros across different sheets

    I cannot test but this would be a better way for your code to work

    Please Login or Register  to view this content.
    I noticed you only closed and saved the first workbook, the others may prompt to save if you want to save these too just add TRUE behind the tempWb.Close

+ 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. [SOLVED] Event Driven Macros stop running after running a routine macro
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2017, 12:34 PM
  2. Running macros on protected work sheets
    By Herr Rommel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2016, 11:16 PM
  3. [SOLVED] Running macros with protected sheets
    By RebeccaEllis in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 08-07-2012, 05:01 PM
  4. [SOLVED] Excel 2007 : Running Macros on Protected Sheets
    By ExcelNewbie2534 in forum Excel General
    Replies: 5
    Last Post: 04-16-2012, 07:36 PM
  5. Showing sheets and forms, not running macros, from add in
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-28-2009, 09:02 AM
  6. running macros on protected sheets
    By baz0912 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2008, 08:12 AM
  7. running macros on protected sheets
    By baz0912 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2008, 05:11 AM

Tags for this Thread

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