Use VBA to Copy Data from Multiple Sheets when Multiple Criteria Met

cherismith

New Member
Joined
Mar 14, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
I have a file (named "TEST Consolidate Data") with 6 sheets:
Sheet 1 = "EPT"
Sheet 2 = "Str Stacker"
Sheet 3 = "LFPPT"
Sheet 4 = "roster"
Sheet 5 = "Consolidated"
Sheet 6 = "Upload"

I want to find data in sheets 1, 2, and 3 that match 2 criteria (column I = date within the last 7 days and column K = "Pass"). I want to paste the results into columns with all the same headers in sheet 5.
I will then use other formulas, such as VLOOKUP, in sheet 6 to pull certain pieces of data from sheet 5 into the format needed by another system to upload the data.
I will need this task to be done once per week, so perhaps the best way would be for a button to sit on the 'Consolidated' tab that the user can press to make the VBA run and the data update (delete existing data apart from the headers, which are in row 3).

I have tried a couple of different pieces of code I found online/on this site, but I couldn't quite find anything that would work as I needed it to. How can I do this?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
This is an image of the data in the workbook
 

Attachments

  • 2022-03-14_13h55_50.png
    2022-03-14_13h55_50.png
    60.1 KB · Views: 15
Upvote 0
I want to find data in sheets 1, 2, and 3 that match 2 criteria (column I = date within the last 7 days and column K = "Pass").
Did you try an easy Excel basics like a filter or an advanced filter ?​
 
Upvote 0
Did you try an easy Excel basics like a filter or an advanced filter ?​
I should have said that I won't be me using the file. It will be other people who aren't very familiar with excel and there will be too much time spent copying and pasting data if they do it manually as there are in reality a lot more than 3 sheets of data, I just made it three for my question to keep it simple as I knew I'd be able to adapt it to include more sheets later. I thought using a FILTER formula would only work for one sheet of data, not multiple. If there's a way you think I can do this that keeps it very simple for the user without using VBA, I'm happy to do so.
 
Upvote 0

Forum statistics

Threads
1,214,865
Messages
6,121,988
Members
449,060
Latest member
mtsheetz

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