Mornin Ya'll.
I've got a question on sheet 2 asking for a pressure, and a column on sheet 1 with multiple flange ratings. What I'd like the script to do is filter the flange ratings based on the pressure entered.
For example, if the user entered 350 psi it would filter out everything below 350 (100# and 300#) but show everything above 350 (600#, 900#, 1500#, and 2500#).
I was trying to use the AutoFilter function but can't get it to filter more than one thing at any one time:
'Flange Rating
pressure = sh2.Range("C5").Value
If pressure > 0 And < 150 Then
sh1.Columns("Y").AutofilterMode = False 'Shows all ratings if pressure is < 150
ElseIf pressure > 150 And pressure < 300 Or pressure = 300 Then
sh2.Range("A2").AutoFilter 25, "300" And "600" And "900" And "1500" And "2500" 'Filters everything below 300 out
ElseIf pressure > 300 And pressure < 600 Or pressure = 600 Then
.....
Any help is much appreciated!
I've got a question on sheet 2 asking for a pressure, and a column on sheet 1 with multiple flange ratings. What I'd like the script to do is filter the flange ratings based on the pressure entered.
For example, if the user entered 350 psi it would filter out everything below 350 (100# and 300#) but show everything above 350 (600#, 900#, 1500#, and 2500#).
I was trying to use the AutoFilter function but can't get it to filter more than one thing at any one time:
'Flange Rating
pressure = sh2.Range("C5").Value
If pressure > 0 And < 150 Then
sh1.Columns("Y").AutofilterMode = False 'Shows all ratings if pressure is < 150
ElseIf pressure > 150 And pressure < 300 Or pressure = 300 Then
sh2.Range("A2").AutoFilter 25, "300" And "600" And "900" And "1500" And "2500" 'Filters everything below 300 out
ElseIf pressure > 300 And pressure < 600 Or pressure = 600 Then
.....
Any help is much appreciated!