Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
AutoFilter
Hi
The code below allows the user to enter two dates to filter on columnA. i.e = dd-mm-yy and a < dd-mm-yy. My problem is trying to add columnH to the code to filter for "YES". The error message is 'Run TIme Error 438 Object doesn't support this property or method. 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 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 MySecondDate = Range("K1") * 1 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? Selection.AutoFilter Field:=8, Criteria1:="YES" wsdYsr.[G28].Value = wbscWgs.[E6].Value 'Transfer to Sheet2 End sub -- Thank you Regards Aussie Bob C. Using Windows XP Home + Office 2003 Pro SP2 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
AutoFilter
Maybe....
Selection.AutoFilter Field:=8, Criteria1:="YES" becomes rows("8:8").AutoFilter Field:=8, Criteria1:="YES" Robert Christie wrote: Hi The code below allows the user to enter two dates to filter on columnA. i.e = dd-mm-yy and a < dd-mm-yy. My problem is trying to add columnH to the code to filter for "YES". The error message is 'Run TIme Error 438 Object doesn't support this property or method. 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 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 MySecondDate = Range("K1") * 1 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? Selection.AutoFilter Field:=8, Criteria1:="YES" wsdYsr.[G28].Value = wbscWgs.[E6].Value 'Transfer to Sheet2 End sub -- Thank you Regards Aussie Bob C. Using Windows XP Home + Office 2003 Pro SP2 -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
AutoFilter
Hi and Thank You
I was trying to add the line onto the end of the columnA filter routine Field:=1.......Field:=8, similiar to a Sort routine with it's Key1..... Key2 All working fine now. -- Thank you Regards Aussie Bob C. Using Windows XP Home + Office 2003 Pro SP2 "Dave Peterson" wrote: Maybe.... Selection.AutoFilter Field:=8, Criteria1:="YES" becomes rows("8:8").AutoFilter Field:=8, Criteria1:="YES" Robert Christie wrote: Hi The code below allows the user to enter two dates to filter on columnA. i.e = dd-mm-yy and a < dd-mm-yy. My problem is trying to add columnH to the code to filter for "YES". The error message is 'Run TIme Error 438 Object doesn't support this property or method. 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 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 MySecondDate = Range("K1") * 1 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? Selection.AutoFilter Field:=8, Criteria1:="YES" wsdYsr.[G28].Value = wbscWgs.[E6].Value 'Transfer to Sheet2 End sub -- Thank you Regards Aussie Bob C. Using Windows XP Home + Office 2003 Pro SP2 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel 2007 autofilter change to 2003 autofilter functionality? | Excel Discussion (Misc queries) | |||
2007 excel autofilter back to 2003 autofilter? | Excel Discussion (Misc queries) | |||
2007 excel autofilter change back to 2003 autofilter? | Excel Discussion (Misc queries) | |||
2007 Autofilter worse than 2003 Autofilter | Excel Discussion (Misc queries) | |||
How to Sort within AutoFilter with Protection on (and AutoFilter . | Excel Discussion (Misc queries) |