VBA SUMIFS - 0 value excluded from list

Villalobos

New Member
Joined
Sep 5, 2013
Messages
44
Hello, I use the below mentioned code the sum and paste the data from sheets(1) to sheets(2). My problem is that I can not exclude the 0 value from list. Could somebody help me how should I do?
Code:
Sub GetBacklog()
     Dim lastRow&, filterCriteria$
         filterCriteria = "<=" & Sheets("List of urgent products").Range("A1")
             With Sheets(1)
                 lastRow = .Cells(.Rows.Count, 36).End(xlUp).Row
                 ThisWorkbook.Names.Add Name:="Summarize", RefersToR1C1:="='" & .Name & "'!R28C36:R" & lastRow & "C36"
             End With
             With Sheets(2)
                 Range("Summarize").AdvancedFilter xlFilterCopy, , .Range("B12"), True
                 .Range("C13:C500").Value = "=SUMIFS('" & Sheets(1).Name & "'!$AM$29:AM" & lastRow & ",'" & Sheets(1).Name & "'!$AK$29:AK" & lastRow & "," & Chr(34) & filterCriteria & Chr(34) & ",'" & Sheets(1).Name & "'!$AJ$29:AJ" & lastRow & "," & Sheets(2).Range("B13").Address(0, 0) & ")"
                 .[C12] = "Required quantity"
             End With
End Sub
 

Some videos you may like

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Watch MrExcel Video

Forum statistics

Threads
1,122,206
Messages
5,594,832
Members
413,943
Latest member
Dhornsby21

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
Top