[VBA] Pulling data from all sheets in a workbook arranged in different columns

eddyble

New Member
Joined
Apr 30, 2018
Messages
9
Hi Guys - pretty stuck and not even sure what to google, so hoping some experts could help me out.

I've created a macro that pulls all Worksheet names and notes them down in a newly created 'Master_Sheet' in Row 1 (Sheet 1 -> Sheet x) starting from B1.
It then pulls a column from every Worksheet and puts that data into Column A putting each Sheet's data underneath the previous Sheet's data (apologies if this is unclear, output below).

NameSheet 1Sheet 2Sheet 3
A (Sheet 1)
B (Sheet 1)
C (Sheet 1)
A (Sheet 2)
D (Sheet 2)
B (Sheet 3)
F (Sheet 3)

The script then deletes duplicates in Column A (i.e D is now A5 and F is now A6).

Here's where I'm stuck. Each 'Name' on each Sheet corresponds with some number a few Columns over (Example below). I would like some way to get that number and 'match' it to the 'Name' on the Master_Sheet in the corresponding Sheet Column.

Sheet 2
Name
A3
D4


Essentially, the output line C2 on the Master_Sheet would be = 3 and C5 = 4

Sheet 3
Name
B5
F6

Master_Sheet would show D3 = 5 and D6 = 6

This would loop for all Sheets in the workbook.

Apologies for the lengthy explanation, hopefully it's clear enough that someone can lend me a hand as i'm properly stuck.

Thank you in advance -
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I solved it - it's not an eloquent solution... but it involved a lot of vlookups. Either way, the dataset will never be too large for this to be cumbersome.
 
Upvote 0

Forum statistics

Threads
1,215,592
Messages
6,125,713
Members
449,253
Latest member
Mbogo

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