Match Dates from multiple sheets using VBA

pawarful1

New Member
Joined
Apr 3, 2022
Messages
1
I have a sheet that has 10 column headers that match the names of the 10 sheets. As an example, if I am in Sheet 1, I have columns headers as "Sheet 2", "Sheet 3", "Sheet 4" and so on. Theses headers match the names of the 10 sheets, Sheet 2 through Sheet 11. I also have dates in Sheet 1 going down in row 6 through 300. The sheets 2 and Sheet 11 also have dates going down in rows 6 through 300. I would like a VBA code that will first match the month and year in Sheet 1 with the month and year in each of Sheets 2 through Sheet 11 and then paste the values from Column Q in sheets 2 through Sheet 11 under the respective sheet headers in Sheet 1. Right now I have an excel formula that does the job but takes a a long time to calculate the cells - INDEX(INDIRECT("'ID# "&F$4&"'!"&"$C$24:$S$300"),MATCH(TEXT($B6,"mmmyy"),TEXT(INDIRECT("'ID# "&F$4&"'!"&"$C$24:$C$300"),"mmmyy"),0),15)) . In the formula, F4 has the column header and B6 has the date in Sheet 1. The columns headers are in columns F4 through O4. I need a VBA code that will dynamically match the date in rows B6 through B300 in sheet 1 with the dates in the other 10 sheets and put the values in column Q. Any help is greatly appreciated.

Thanks,
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,213,521
Messages
6,114,109
Members
448,548
Latest member
harryls

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