Populating various columns from different workbooks into centralized table.

JayGatsby

New Member
Joined
Apr 27, 2020
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
Hello! I have few csv files (all data in separate columns),e.g file1,file2,file3, file4 and I’d like to combine those in one table in excel placed within separate sheet with static headings. The files have a different structure (i.e. the columns containing relevant info differ/are in different order) and need to be pasted without headings into a table of consistent format (e.g. where column “name” would be fitted in e.g column B2). The location of column “name” would differ per file but that can be adjusted in the code itself.

If possible, I would like to do this without having to open the CSVs, so basically the table within the main sheet would get populated with the data from each (closed) csv based on given path/location. Also, once file 1 is done populating, the file 2 should be populated below without headers (different source columns per file into same destination column below one another). The size of files will vary so it would be good to have the range set as dynamic but the column A of each file defines the number of rows that should be copy/pasted.



Example of the table:



File1 (csv):

SportNationalityNameSurnameCityClassCountryPosition
FootballTurkeyKateBlackNewcastle54Turkeymidfielder
RugbyAustraliaBillWhiteRome11Australiastriker


File2 (csv):

First nameSecond nameActivityOriginGroupLocation
JoeNewtonHockeyGeorgia22Georgia
JackSmithTennisJapan34Japan


Desired result in main sheet:

ActionNationalityRatingNameSurname
FootballTurkey54KateBlack
RugbyAustralia11BillWhite
HockeyGeorgia22JoeNewton
TennisJapan34JackSmith
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top