Copy a range of cells from multiple worksheet to a summary worksheet based on a condition

pce

New Member
Joined
Dec 16, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm new to VBA and currently still learning. My problem is that I want to be able to copy a set of data from multiple worksheets in a workbook based on a date search and have these data paste to a summary worksheet in the same workbook.

For example: I want to copy data from sheet A-I that are dated to the date in Summary!B12 and paste the values to its corresponding column in the summary sheet.
1. summary sheet
1639647132841.png

2.Data in SheetA

1639647209146.png


3. Data in SheetB
1639647248800.png


The format of data is different from each sheets but they all have a heading e.g. code, 72 hours etc... but some doesn't include 72 hours, 96 hours etc..

Any help would be great. I tried the sumif function but I have multiple workbooks where the layout of the codes, hours etc. changes for each sheets so the sumif would only work for one workbook then I would have to type a different function formula for each. I was hoping I can use a VBA macro code and apply it to a different workbook which contains similar data but the layout would be different.
Thanks.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hello,

I'm new to VBA and currently still learning. My problem is that I want to be able to copy a set of data from multiple worksheets in a workbook based on a date search and have these data paste to a summary worksheet in the same workbook.

For example: I want to copy data from sheet A-I that are dated to the date in Summary!B12 and paste the values to its corresponding column in the summary sheet.
1. summary sheet
View attachment 53508
2.Data in SheetA

View attachment 53509

3. Data in SheetB
View attachment 53510

The format of data is different from each sheets but they all have a heading e.g. code, 72 hours etc... but some doesn't include 72 hours, 96 hours etc..

Any help would be great. I tried the sumif function but I have multiple workbooks where the layout of the codes, hours etc. changes for each sheets so the sumif would only work for one workbook then I would have to type a different function formula for each. I was hoping I can use a VBA macro code and apply it to a different workbook which contains similar data but the layout would be different.
Thanks.
EDIT: For example: I want to copy data from sheet A-I that are dated to the date in * Summary!B2 and paste the values to its corresponding column in the summary sheet.
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

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