HunterN
Active Member
- Joined
- Mar 19, 2002
- Messages
- 479
Hi,
I have the following columns on a sheet:
A B C D
NAME SIZE LOCATION ACTION
PESAF 2 951-952 N
PESB1 3 953-955 M
PESB2 2 XXX-XXX D
PESC1 2 956-957 M
I need to filter out all the rows that have a 'D' in the Action column, using VBA.
I can't seem to get this!
I recorded a macro and it was the following:
Sub Macro1()
Range("D1").select
Range(selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=1, Criteria1:="=M", Operator:=xlOr, _
Criteria2:="=N"
Range("A1:E1").select
End Sub
But this is not working for me in the actual program. I could use some help!
Thanks, Nancy
I have the following columns on a sheet:
A B C D
NAME SIZE LOCATION ACTION
PESAF 2 951-952 N
PESB1 3 953-955 M
PESB2 2 XXX-XXX D
PESC1 2 956-957 M
I need to filter out all the rows that have a 'D' in the Action column, using VBA.
I can't seem to get this!
I recorded a macro and it was the following:
Sub Macro1()
Range("D1").select
Range(selection, Selection.End(xlDown)).Select
Selection.AutoFilter Field:=1, Criteria1:="=M", Operator:=xlOr, _
Criteria2:="=N"
Range("A1:E1").select
End Sub
But this is not working for me in the actual program. I could use some help!
Thanks, Nancy