+ Reply to Thread
Results 1 to 6 of 6

Macro to combine 2 files and add columns(which has Vlookup formulas in)

  1. #1
    Registered User
    Join Date
    04-22-2016
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    23

    Macro to combine 2 files and add columns(which has Vlookup formulas in)

    Hi,

    I need assistance with a Macro.

    I receive 2 workbooks on a daily basis, Workbook A & B.

    Workbook A is the static workbook and i would like to only pull in 1 tab into Workbook A from Workbook B.

    Thereafter I want the macro to create 5 new columns(Columns H & I + R,S,T) in every tab in Workbook A(has around 10 tabs) and it needs to insert a vlookup in those columns between data from Workbook A & B

    i want to run this Macro on a daily basis on the new A & B workbooks.



    Any assistance would be appreciated.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-30-2019
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    72

    Re: Macro to combine 2 files and add columns(which has Vlookup formulas in)

    So you want to pull the data tab into workbook A from Workbook B and then insert 5 new columns in the already existing sheets or replace the old ones that are already there? A little confused by your question.

  3. #3
    Registered User
    Join Date
    04-22-2016
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    23

    Re: Macro to combine 2 files and add columns(which has Vlookup formulas in)

    So you want to pull the data tab into workbook A from Workbook B and then insert 5 new columns in the already existing sheets

    Yes this is it

  4. #4
    Registered User
    Join Date
    09-30-2019
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    72

    Re: Macro to combine 2 files and add columns(which has Vlookup formulas in)

    Hey! This doesn't put any vlookups in the functions but it does do the other part I think...I'm fairly new to VBA but am trying to help you so let me know any feedback and I'll do what I can!

    Please Login or Register  to view this content.
    As far as inserting the Vlookup, it'd be tough because the sheets have gaps and I also don't know what the vlookup is looking at.

  5. #5
    Registered User
    Join Date
    04-22-2016
    Location
    South Africa
    MS-Off Ver
    2010
    Posts
    23

    Re: Macro to combine 2 files and add columns(which has Vlookup formulas in)

    Thank you but I receive the following error when trying to run the code :

    Run-time error '9':
    Subscript out of range

  6. #6
    Registered User
    Join Date
    09-30-2019
    Location
    Chicago
    MS-Off Ver
    2016
    Posts
    72
    Quote Originally Posted by Aredeekay View Post
    Thank you but I receive the following error when trying to run the code :

    Run-time error '9':
    Subscript out of range
    Which line gives you the error? It works when I run it between workbook a and workbook b that you provided.

+ 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: 1
    Last Post: 01-25-2016, 03:19 PM
  2. Combine Files Using Vlookup
    By Vadimchik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2014, 07:55 AM
  3. [SOLVED] Combine Formulas - Vlookup: Blanks, Errors, Values
    By Emili Excel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2014, 01:28 PM
  4. Combine many files into a single worksheet with additional columns
    By rckbsi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2013, 05:21 PM
  5. [SOLVED] Combine vlookup and countif formulas
    By StrydomM in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-31-2013, 01:44 AM
  6. [SOLVED] Using Combine macro to combine multiple worksheets - need to modify to paste formulas
    By DLSmith in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2012, 09:07 AM
  7. Replies: 3
    Last Post: 07-12-2006, 08:20 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