Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why my code do not work : - (
Try
x= "=" & range("B1").Value2 y = "=" & Range("C1").Value2 Note the 2 on the end of value. -- Regards, Tom Ogilvy Soniya wrote in message ... Hi all, this is what i got while recording macro and worked fine.. Sheets("IncomeData").Select Range("A2").Select Range(Range("A2:F2"), Range("A2:F2").End (xlDown)).Select Selection.AutoFilter Field:=5, Criteria1:="=01/07/2003", Operator:=xlAnd _ , Criteria2:="<=01/08/2003" But when I changed it to: x= "=" & range("B1") y = "=" & Range("C1") Range(Range("A2:F2"), Range("A2:F2").End (xlDown)).Select Selection.AutoFilter Field:=5, Criteria1:=x, Operator:=xlAnd _ , Criteria2:=y then no record shows in the filtered data.. while there are several records meet the condition.. What would be the possible reason for this strange behaviour...? (I am using XL XP) TIA Soniya |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why my code do not work : - (
Another possibility
x= "=" & cDate(range("B1")) y = "<=" & cDate(Range("C1")) also, I noticed that both your operators are "=" I assume one should be "<=" (probably y). -- Regards, Tom Ogilvy Tom Ogilvy wrote in message ... Try x= "=" & range("B1").Value2 y = "=" & Range("C1").Value2 Note the 2 on the end of value. -- Regards, Tom Ogilvy Soniya wrote in message ... Hi all, this is what i got while recording macro and worked fine.. Sheets("IncomeData").Select Range("A2").Select Range(Range("A2:F2"), Range("A2:F2").End (xlDown)).Select Selection.AutoFilter Field:=5, Criteria1:="=01/07/2003", Operator:=xlAnd _ , Criteria2:="<=01/08/2003" But when I changed it to: x= "=" & range("B1") y = "=" & Range("C1") Range(Range("A2:F2"), Range("A2:F2").End (xlDown)).Select Selection.AutoFilter Field:=5, Criteria1:=x, Operator:=xlAnd _ , Criteria2:=y then no record shows in the filtered data.. while there are several records meet the condition.. What would be the possible reason for this strange behaviour...? (I am using XL XP) TIA Soniya |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why does this code not work? | Excel Discussion (Misc queries) | |||
Why this code is not work? | Excel Worksheet Functions | |||
code is not to work on sheet1 | New Users to Excel | |||
Why my code do not work : - ( | Excel Programming | |||
Why my code do not work : - ( | Excel Programming |