T
TIMOTHY
Hi all
please help me, i want to filter three columns pubid=0877,
royalty=10, and then type=trad_cook
i've recorded the following, my problem is if i know the column name
only not column no. And can you can you minimise the code.
Sub macro3()
Activecell.Rows("1:1").Entirerow.Select
Selection.Autofilter
Activecell.offset(0,3).range("a1").select
activesheet.range("$a$1:$j$19").autofilter field:=4, criteria1="0877"
Activecell.offset(0,3).range("a1").select
activesheet.range("$a$1:$j$19").autofilter field:=7, criteria1="10"
Activecell.offset(0,-4).range("a1").select
activesheet.range("$a$1:$j$19").autofilter field:=3,
criteria1="trad_cook"
Activecell.offset(0,-2).range("a1:j19").select
activecell.activate
selection.copy
sheets("filtereddata").select
activesheet.paste
application.cutcopymode=false
end sub
please help me, i want to filter three columns pubid=0877,
royalty=10, and then type=trad_cook
i've recorded the following, my problem is if i know the column name
only not column no. And can you can you minimise the code.
Sub macro3()
Activecell.Rows("1:1").Entirerow.Select
Selection.Autofilter
Activecell.offset(0,3).range("a1").select
activesheet.range("$a$1:$j$19").autofilter field:=4, criteria1="0877"
Activecell.offset(0,3).range("a1").select
activesheet.range("$a$1:$j$19").autofilter field:=7, criteria1="10"
Activecell.offset(0,-4).range("a1").select
activesheet.range("$a$1:$j$19").autofilter field:=3,
criteria1="trad_cook"
Activecell.offset(0,-2).range("a1:j19").select
activecell.activate
selection.copy
sheets("filtereddata").select
activesheet.paste
application.cutcopymode=false
end sub