RE: using Autofilter to find all values < 0 in a named column range.
All I want to do is use Autofilter to find all values less than zero in a column range and just copy the result to the REPORT sheet. I have this so far in the click event in a button, and it works- to a point:
REALBALS is the sheet name that contains the named range "BALANCES2018". The "to a point" phrase means that when this code it run on the BALANCES2018 named range, it always includes the first value at the top of the named range along with the the rest of the correct negative values(<0) - why is the code including that first value at the top - I don't want that - I want the code to list only the negative values ("<0") in the range. I know it's got to be something simple.
Thanks for anyone's help.
cr
All I want to do is use Autofilter to find all values less than zero in a column range and just copy the result to the REPORT sheet. I have this so far in the click event in a button, and it works- to a point:
Code:
Private Sub cmdNegatives_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
Sheets("REALBALS").Activate
Range("BALANCES2018").Select 'new 12.17.17
With Selection
.AutoFilter Field:=2, Criteria1:="<0"
.SpecialCells(xlVisible).Copy Sheets("REPORT").Range("A1:B1")
End With
Selection.AutoFilter
Sheets("BUDGET").Activate
Application.EnableEvents = True
Application.ScreenUpdating = True
'' Selection.AutoFilter
End Sub
Thanks for anyone's help.
cr
Last edited: