U_Shrestha
05-06-2008, 07:46 AM
Hi, I need help with filtering column with followiing conditions. I received following code from recording macro but this somehow doesn't seem to be right. Please note that my table heading is located at Row 5.
1) From Column I, select "In-service" AND "Temporarily Out of Service"
2) From Column H, select "*U/G"
3) From Column M, select "FRP"
4) From Column Q, select "None" AND "vaule w/access"
Recording the macro doesn't seem to be right for item 2) and 4). Can someone please edit the code? Thanks.
Sub SWFRPUSTs()
Selection.AutoFilter Field:=7, Criteria1:="=1. In-Service", Operator:= _
xlAnd
Selection.AutoFilter Field:=6, Criteria1:="=*U/G*", Operator:=xlAnd
Selection.AutoFilter Field:=11, Criteria1:="6. FRP"
Selection.AutoFilter Field:=15, Criteria1:="=0. None", Operator:=xlAnd
End Sub
1) From Column I, select "In-service" AND "Temporarily Out of Service"
2) From Column H, select "*U/G"
3) From Column M, select "FRP"
4) From Column Q, select "None" AND "vaule w/access"
Recording the macro doesn't seem to be right for item 2) and 4). Can someone please edit the code? Thanks.
Sub SWFRPUSTs()
Selection.AutoFilter Field:=7, Criteria1:="=1. In-Service", Operator:= _
xlAnd
Selection.AutoFilter Field:=6, Criteria1:="=*U/G*", Operator:=xlAnd
Selection.AutoFilter Field:=11, Criteria1:="6. FRP"
Selection.AutoFilter Field:=15, Criteria1:="=0. None", Operator:=xlAnd
End Sub