VBA Copy and Paste if specific criteria into master sheet

jmurray394

New Member
Joined
Mar 7, 2022
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Hi!

I could really use some VBA help since I’m very much a beginner. I have a workbook that has a master worksheet and 13 subsequent tabs. The master tab lists the names of people working in my department from columns A – P. The 13 tabs that follow all have the same layout of two columns: the person’s name and purchase their responsible for. I’m trying to get it where the code goes through each tab and if it comes across a specific criteria (the person’s name in Column A) it will then automatically copy the purchase type (Column B Value) and paste it under their name in the master sheet.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi J,
that sounds like a simple macro challenge to start with, how far did you get yourself? Please post the code you wrote here (as this site is not a free coding service). This is some code that could help you (untested):
VBA Code:
Sub LoopSheetsEtc
Set Wb=ActiveWorkbook
For each Sht in Wb.Worksheets
  LastRw = Sht.Range("A1").End(XlDown).Row
  For Rw = 1 to LastRw
    ...
  Next Rw
Next Sht
End Sub
And if you want to learn a bit more, try e.g. recording a macro or following a course like Excel VBA Programming - a free course for complete beginners , VBA Training | Wise Owl etc.
Cheers,
Koen
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,743
Members
449,094
Latest member
dsharae57

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