Filter for ABS

ItalianPlatinum

Active Member
Joined
Mar 23, 2017
Messages
287
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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
48,497
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
287
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
48,497
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,114,607
Messages
5,548,954
Members
410,884
Latest member
melifreeman
Top