Need help with Criteria1

G

Guest

Hi,

Having a mental block or a breakdown not sure which!

In the following Criteria1 = "2005". What I need it to do is for it to be
the same as "Sheet1!B10" and get year from there. Can't seam to get it to
work. Where am I going wrong?



With
Worksheets("Selected_Agency_Details").Range("A1").CurrentRegion
.AutoFilter Field:=9, Criteria1:="2005"
.SpecialCells(xlCellTypeVisible).Copy _
Worksheets("Selected_Agency_Year").Cells(1, 1)
.AutoFilter
End With


Thanks for help.

Trev B
 
B

Bob Phillips

With Worksheets("Selected_Agency_Details").Range("A1").CurrentRegion
.AutoFilter Field:=9, Criteria1:=Worksheets("Sheet1").Range("B10")
.SpecialCells(xlCellTypeVisible).Copy _
Worksheets("Selected_Agency_Year").Cells(1, 1)
.AutoFilter
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top