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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Fluff

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

Watch MrExcel Video

Forum statistics

Threads
1,113,866
Messages
5,544,770
Members
410,632
Latest member
The_Steward
Top