Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Why my code do not work : - (
Soniya,
Try this x = "=" & Format(Range("B1"),"dd/mm/yyyy") y = "<=" & Format(Range("C1"),"dd/mm/yyyy") or x = "=" & CStr(Range("B1")) y = "<=" & CStr(Range("C1")) -- HTH Bob Phillips "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 | |||
Maco code doesn't work. Why? | Excel Discussion (Misc queries) | |||
Why does this code not work? | Excel Discussion (Misc queries) | |||
Event code won't 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 |