Filter for ABS

ItalianPlatinum

Active Member
Joined
Mar 23, 2017
Messages
390
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
Hello - Looking for a way within my existing VBA to capture a filter so it filters if something is greater than ABS of lets just say 1. for example i have field 11 with values and i want it to filter by anything equal to or greater than 1. Is the only way to create another column with an ABS Formula in it then filter off of that? i would prefer not to go that route if possible

VBA Code:
If Not ActiveSheet.AutoFilterMode Then ActiveSheet.Range("10:10").AutoFilter

Range("10:10").AutoFilter Field:=3, Criteria1:="<>" & Range("D7")
Range("10:10").AutoFilter Field:=10, Criteria1:="AA", Operator:=xlOr, Criteria2:="BB"
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
50,886
Office Version
  1. 365
Platform
  1. Windows
You can filter between, like
Range("10:10").AutoFilter Field:=1, Criteria1:=">=2", Operator:=xlOr, Criteria2:="<=-2"
 

ItalianPlatinum

Active Member
Joined
Mar 23, 2017
Messages
390
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
You can filter between, like
Range("10:10").AutoFilter Field:=1, Criteria1:=">=2", Operator:=xlOr, Criteria2:="<=-2"
that works! thanks, annoyed i didn't even think of that :rolleyes:
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
50,886
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,788
Messages
5,574,287
Members
412,584
Latest member
Leow
Top