ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with Criteria1 (https://www.excelbanter.com/excel-programming/380722-need-help-criteria1.html)

Trever B

Need help with Criteria1
 
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

Bob Phillips

Need help with Criteria1
 
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)

"Trever B" wrote in message
...
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





All times are GMT +1. The time now is 07:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com