+ Reply to Thread
Results 1 to 2 of 2

HELP!!! Fastest code in consolidating columns with different headers

  1. #1
    Forum Contributor
    Join Date
    04-22-2013
    Location
    Philippines
    MS-Off Ver
    Office 365, Excel 2016
    Posts
    146

    HELP!!! Fastest code in consolidating columns with different headers

    Hi,

    I am looking for a fastest code that will do the flow below. I have 2 workbooks wtih "maindata" and "sourcedata" sheet. The sourcedata sheet has 100+ columns and thousands of data. The maindata sheet is where all the needed data from the sourcedata sheet should be copied. maindata new sheet has already have the headers (Row 1).

    The tool flows like this:
    1] get the value in sheet maindata B1
    2] find the value in sheet sourcedata columns 1-100
    3] when the value is found or exactly the same headers, copy the entire column from sheet sourcedata to sheet maindata of the same header
    4] when the value is not found, go to next value in sheet maindata C2
    5] and repeat step 2 or 4 until all headers in sheet maindata are populated


    Additional functions needed are:
    1. Each files to be opened should have count of rows copied
    2. For each file copied, column 1 should be filled up by filename
    3. repeat the whole process for all the files opened



    I am not yet expert to use arrays and for loops so I will be needing a help to code this.

    Attach are the files. Consolidation Automation is the maindata and the 2.csv is the sourcedata.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: HELP!!! Fastest code in consolidating columns with different headers

    Hi Sarah

    See this link...same issue???
    http://www.excelforum.com/excel-prog...-part-2-a.html
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ 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] Fixing code of consolidating columns.
    By kleptilian in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-18-2015, 08:09 AM
  2. How to loop through massive data with fastest code
    By caooi23 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2015, 02:24 AM
  3. Replies: 1
    Last Post: 12-18-2014, 09:43 PM
  4. [SOLVED] Fastest way to find a duplicate value in two large columns
    By ArnolddG in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-28-2014, 05:05 AM
  5. [SOLVED] fastest vba code to add (many) new rows into a protected table at the same time
    By jimmalk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-23-2012, 07:23 AM
  6. Fastest code to copy a range down
    By skysurfer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2010, 07:54 PM
  7. Fastest Loop Code?
    By Chard in forum Excel General
    Replies: 2
    Last Post: 05-29-2007, 11:17 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