+ Reply to Thread
Results 1 to 2 of 2

Running two macros as one

  1. #1
    Registered User
    Join Date
    09-25-2011
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    45

    Running two macros as one

    Hi,

    I'm using Ron de Bruin's Merge worksheets code (adapted for my needs) to combine two sets of workbooks. I've added in my own code as well to edit these merged sheets. The code opens a browser for the user to select a folder and then merge the workbooks in that folder.

    I've inserted a module to merge and edit each set of workbooks - Combine_T & Combine_H, and then added a third module, Merge, to call these macros to run as one.

    It seem to work fine as far as opening the browser window, merging and then opening another window to browse and merge the second set on Sheet2.

    The problem is it only seems to do the editing for one set of merged books, and then only merge the second set. So if I run Merge, it will merge and edit Combine_T, but then only merge Combine_H.

    I've tested it as well and if I run it from Sheet2, it merge and edit Combine_H, and only merge Combine_T on Sheet1.

    I've attached a workbook with the code since it's too long to post.

    Shout if I haven't been clear!
    Attached Files Attached Files
    Last edited by Seraph84; 11-10-2011 at 07:46 AM.

  2. #2
    Registered User
    Join Date
    09-25-2011
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    45

    Re: Running two macros as one

    Ok so I changed the code in Module 2 (Combine_H), to open a new workbook and add a sheet instead of merging and editing the data in Sheet2 of workbook I'm running the macro from, and it works fine.

    Any idea as to why this is so?

+ 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