Hi guys!
I'd like to SUM values return by the filter. The problem is that the SUM is considering all data and not just the filter return.
Filter Code
Follows the image bellow.
The value returned on the second image should be 105 and not 275.
Thanks in advance
I'd like to SUM values return by the filter. The problem is that the SUM is considering all data and not just the filter return.
Filter Code
Code:
Public Sub Filter()
Dim lStart As Long, lEnd As Long
lStart = Range("F1").Value
lEnd = Range("F2").Value
Range("B1:B500").AutoFilter field:=1, _
Criteria1:=">=" & lStart, _
Operator:=xlAnd, _
Criteria2:="<=" & lEnd + 1
End Sub
Follows the image bellow.
The value returned on the second image should be 105 and not 275.
Thanks in advance
Last edited: