+ Reply to Thread
Results 1 to 7 of 7

Copy Columns to Different Workbook Based on Header Values

  1. #1
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Copy Columns to Different Workbook Based on Header Values

    I'm trying to copy and paste columns in one workbook to another workbook based on matching header values. I can't seem to make it work.

    I've attached 2 sample files. I need the data from Example1a to be copied to Example1b, and the macro needs to live in Example1a workbook. Any ideas?

    Thanks!!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Copy Columns to Different Workbook Based on Header Values

    my idea, both files has to be in the same directory


    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy Columns to Different Workbook Based on Header Values

    FWIW:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Copy Columns to Different Workbook Based on Header Values

    Leo, it works great except for one issue. The destination sheet has "Production" and "Prod" headers, and the "Prod" column from the original worksheet is copying to the "Production" column on the second sheet. Any ideas?

  5. #5
    Forum Contributor
    Join Date
    02-18-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2013
    Posts
    197

    Re: Copy Columns to Different Workbook Based on Header Values

    John, your code works perfectly!

    Thanks so much!

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copy Columns to Different Workbook Based on Header Values

    You're welcome. Glad to help out and thanks for the feedback.

  7. #7
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: Copy Columns to Different Workbook Based on Header Values

    correction made


    Kind regards
    Leo
    Attached Files Attached Files

+ 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. Macro to delete all columns in a workbook based on header name
    By Kencosgrove in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-15-2015, 12:09 PM
  2. [SOLVED] Copy columns based on header (Without header)
    By Michael_BU in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-15-2014, 08:07 AM
  3. [SOLVED] Sort the order of columns based on values of header?
    By Granite-Granny in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2014, 08:05 PM
  4. Copy, Paste values from One workbook To another, no header
    By knevil in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2013, 06:59 PM
  5. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  6. Replies: 2
    Last Post: 10-13-2012, 03:30 AM
  7. [SOLVED] Copy columns by header value and paste them in a specific order into another workbook
    By KeriM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2012, 11:13 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