Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Autofilter using a second column
Hi everyone
The code below works Ok until I try to add a line of code to filter on "YES" in column H. Sub Transfer_Value() ' IN USE 22-01-2006 Dim dDate As Date Dim fDate As Date Dim wsdYsr As Worksheet ' Desination worksheet Dim wbscWgs As Worksheet ' Source worksheet Set wsdYsr = Workbooks("Book1.xls").Worksheets("Sheet1") Set wbscWgs = Workbooks("Book2.xls").Worksheets("Sheet2") ActiveSheet.AutoFilterMode = False ' Take the Autofilter off Application.ScreenUpdating = False dDate = CDate(InputBox("Enter First Day Year")) [K2].Value = dDate fDate = CDate(InputBox("Enter First Day of following Year")) [K1].Value = fDate MyFirstDate = Range("K2") * 1 ' force to a LONG MySecondDate = Range("K1") * 1 ' force to a LONG Rows("8:8").AutoFilter Rows("8:8").AutoFilter Field:=1, Criteria1:="=" & MyFirstDate, Operator:=xlAnd _ , Criteria2:="<" & MySecondDate ''' ========== PROBLEM!! How do I include/add this recorded line of code to filter on the 8th column? recorded code:- Selection.AutoFilter Field:=8, Criteria1:="YES" ''' ========= wsdYsr.[g28].Value = wbscWgs.[E6].Value End sub TIA -- Thank you Regards Aussie Bob C. Using Windows XP Home + Office 2003 Pro SP2 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofilter using a second column | Excel Programming | |||
Need help hiding/unhiding column based on autofilter selection in a different column | Excel Programming | |||
Extract AutoFilter Column Values? | Excel Discussion (Misc queries) | |||
Is it possible to use Autofilter, when column labels not in Row 1? | Excel Discussion (Misc queries) | |||
3 Criteria on one column in AutoFilter? | Excel Programming |