Importing columns from multiple workbooks into next available column

Clairekun

New Member
Joined
May 6, 2019
Messages
1
Hello,

Although I assume this is a fairly regular inquiry, I have been unable to find it in the forum, please excuse me if the thread already exists. And sorry if the post is too long, I would like to express myself as clearly as possible.

I have many excel files which I converted from PDF and later polished by combining different macros I found online which would most likely make you cringe (since I have very limited knowledge of VBA and I'm pretty sure the macro, altough working, is a complete mess).

As a result, the excel files (which correspond to different experimental samples, in case it is relevant somehow) have two columns each, formatted as tables, where Column 1 is text and Column 2 is numerical (with some blank cells). Column 1 is the same for each file, but column 2 differs. Also, the sheet where data is stored is renamed to the sample name (relevant later).

What I would need is to have a workbook where Column 1 is imported from any of the files (they're all the same, so it doesn't matter which), where the following columns are the imported Column 2 from the rest of files. Ideally, I would like to choose the files manually; although I could copy and paste them into the same folder, that is not their original location, but this is not mandatory.

Since all Column 2 have the same type of data, the headers are also the same; to know what sample they come from, the imported column headers in the master file would have to be renamed to either the source workbook or worksheet name. I'll try to explain it graphically:

TextData
aa12
bb14
cc16
Sample 1 (worksheet label)

<tbody>
</tbody>

TextData
aa54
bb85
cc96
Sample 2 (worksheet label)

<tbody>
</tbody>

Result:

TextSample 1Sample 2Sample 3, etc.
aa125474
bb148565
cc169645

<tbody>
</tbody>
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,214,983
Messages
6,122,588
Members
449,089
Latest member
Motoracer88

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