Morning all.
I have a column on sheet 1 with different numbers in it (150, 300, 600, 900, 1500, 2500) ad would like to filter it based on the number given on sheet 2, cell B5 (I have the criteria listed on sheet 2 as well). I've tried manually writing the advanced filter macro, and when that didn't work I tried recording it which didn't work either.
Any help is appreciated!
I have a column on sheet 1 with different numbers in it (150, 300, 600, 900, 1500, 2500) ad would like to filter it based on the number given on sheet 2, cell B5 (I have the criteria listed on sheet 2 as well). I've tried manually writing the advanced filter macro, and when that didn't work I tried recording it which didn't work either.
Code:
pressure = sh2.Range("B5").Value
If pressure > 0 And pressure <= 150 Then
sh1.Columns("Y").AutoFilterMode = False
ElseIf pressure >150 And pressure <= 300 Then
sh1.Select
Range("Y3:Y600").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
sh2.Range("BA2:BA6"), Unique = False
End If
Any help is appreciated!