+ Reply to Thread
Results 1 to 4 of 4

Combine Excel Files VBA Code - Need to Set destination workbook as active workbook.

  1. #1
    Registered User
    Join Date
    11-05-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Combine Excel Files VBA Code - Need to Set destination workbook as active workbook.

    Hi,

    I have the below code. It combines multiples files into ONE NEW file.

    Request your help to modify the code.
    Requirement : The sheets to be added in ACTIVE workbook, instead of new book.

    HTML Code: 

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,487

    Re: Combine Excel Files VBA Code - Need to Set destination workbook as active workbook.

    If by Activeworkbook you mean the workbook with the code in it you can use Thisworkbook object
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    11-05-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Combine Excel Files VBA Code - Need to Set destination workbook as active workbook.

    Quote Originally Posted by Andy Pope View Post
    If by Activeworkbook you mean the workbook with the code in it you can use Thisworkbook object
    Hi,

    Thanks for your guidance.

    Final Code
    HTML Code: 
    Last edited by seenai; 06-28-2020 at 08:46 AM.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,097

    Re: Combine Excel Files VBA Code - Need to Set destination workbook as active workbook.

    Try:
    Please Login or Register  to view this content.
    Last edited by Mumps1; 06-28-2020 at 09:07 AM.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

+ 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] vba code to copy a specific sheet from a closed workbook to the active workbook
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-01-2017, 03:09 AM
  2. [SOLVED] VBA - Excel code to copy and paste from several Sharepoint workbook files to one workbook
    By TraceyPatterson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2015, 06:45 AM
  3. How to combine a pool of excel files into one workbook?
    By Andy910104 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-17-2014, 07:00 AM
  4. [SOLVED] Code to detect previous active workbook instead of current active workbook
    By kosherboy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-25-2014, 01:58 AM
  5. Macro to combine many excel files into one workbook/worksheet
    By excel1983 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2012, 02:32 PM
  6. [SOLVED] Edit code to close all workbooks except active workbook and other specific workbook
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2012, 09:29 PM
  7. [SOLVED] Combine CSV files into 1 Excel Workbook as sheets
    By JEFF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2006, 06:10 PM

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