Copying Data from one excel to another Matching Headers


New Member
Jan 26, 2019
I have a few excel which has 23 columns and another few with 7 columns with headers which I get daily with new data. I have another excel which is the master excel where I have all the data updated. My master excel has only 12 headers and columns. The headers are not the same on the master excel and the new excel I get daily. I have all the new files I get daily and my master excel in the same folder. I want a macro that will open all my new excel one by one automatically and I want a macro that can match the headers on the master excel and the new excels I get daily and copy all the data from the daily excel go to my master excel find the next available cell on the master excel and paste the data under the correct header. Data in My master excel is in a table but the daily excel is not in a table. Also on my master excel, the first column is a reference number which is a running number, so every time a data is pasted the number filled with a reference. I want a macro that I can do all this with a click of a button as this is something I do everyday. However, the number of files I get daily is not fixed. Sometimes I get five sometimes seven, sometimes two. The headers on the files I receive is fixed and the header on my master excel is also fixed but they don;t have the same headers.


MrExcel MVP, Moderator
Jun 12, 2014
Office Version
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Forum statistics

Latest member

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...