ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combining 2 autofilters with an OR (https://www.excelbanter.com/excel-programming/277450-combining-2-autofilters.html)

BruceJ

Combining 2 autofilters with an OR
 
I have 2 autofilters and I want to combine them with an OR
Here are the autofilters (they both are currently filtering between times)
Sub time8_11()
'
' time8_11 Macro
' Macro recorded 9/18/2003 by
'

'
Selection.AutoFilter Field:=32, Criteria1:=".333", Operator:=xlAnd, _
Criteria2:="<=.458"
End Sub
Sub time4_930()
'


' time4_930 Macro
' Macro recorded 9/18/2003 by
'

'
Selection.AutoFilter Field:=32, Criteria1:=".6666", Operator:=xlAnd, _
Criteria2:="<=.8953"
End Sub

Basically, it would be like:

Selection.AutoFilter Field:=32, (Criteria1:=".6666", Operator:=xlAnd, _
Criteria2:="<=.8953"), Operator:=xlOr, (Criteria1:=".333",
Operator:=xlAnd, _
Criteria2:="<=.458")
purpose is to look at records with times between (8am and 11am) or (4pm and
9:30pm)
But this did not work...



Thanks!
Bruce







All times are GMT +1. The time now is 01:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com