Copy specific cells (from multiple sheets) to another sheet only when a specific cell value is greater than zero?

mjaeger1

New Member
Joined
Jul 1, 2018
Messages
26
Hi All,

Thanks for you help so far! Sorry if this is confusing. Doing my bets to express my challenge.

I am working on a master quoting tool for a customer. I have multiple sheets for multiple product sets, where I have vlookups pulling data in for columns R, S, T, respectively "part number", "Description", and "Quantity" on each of the 3 separate sheets.

I would like to have these 3 specific cells automatically copied to another 'master sheet' that will combine any row from each sheet that has a 'quantity' entered greater than zero, along with part number, description and quantity. If there is no quantity entered, it should be skipped and not copied.

How can this be done?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Change the name of the sheets containing the products in the macro. Also change the name of your master sheet in the macro.
The macro assumes that you have titles in row 1 and the data starts in row 2.

Try this:
VBA Code:
Sub Copy_specific_cells()
  Dim arr As Variant
  Dim sh As Worksheet, shM As Worksheet
  Dim i As Long
  
  Set shM = Sheets("Master")                  'Master sheet name
  arr = Array("Sheet1", "Sheet2", "Sheet3")   'Sheet names

  For i = 0 To UBound(arr)
    Set sh = Sheets(arr(i))
    If sh.AutoFilterMode Then sh.AutoFilterMode = False
    sh.Range("R1", sh.Range("T" & Rows.Count).End(3)).AutoFilter 3, ">0"
    sh.AutoFilter.Range.Offset(1).Copy shM.Range("A" & Rows.Count).End(3)(2)
    sh.ShowAllData
  Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

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