Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
excel date format problem
Dear All,
i'm trying to set a custom autofilter using VBA/inputboxes. everything seems to work BUT I am trying to filter dates taken from inputboxes and in the process, the days and months are being transposed... eg, in the inputbox, i entered '1/6' meaning '1st June 2008' but the autofilter is showing '6th January 2008'... obviously returning the wrong result. any ideas how to fix that?! I'm using the following syntax to set & use the date variable: - == Dim rng1, rng2 rng1 = Format(CDate(InputBox("from")), "dd/mm/yyyy") rng2 = Format(CDate(InputBox("to")), "dd/mm/yyyy") Selection.AutoFilter Field:=3, Criteria1:="<=" & rng1, Operator:=xlAnd, Criteria2:="=" & rng2 === tia, Tim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Format Problem - Date Overrides Format | Excel Discussion (Misc queries) | |||
Excel 2007 Date Format Problem | Excel Discussion (Misc queries) | |||
Problem with OpenText in Excel 2000 (date format) | Excel Programming | |||
Date format problem in Excel | Excel Programming | |||
Excel 2003, problem with UK date format, using OLE | Excel Programming |