View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
manfareed manfareed is offline
external usenet poster
 
Posts: 94
Default Problem filtering by data 12/01/2002

Hi Ron,

I can leave the code in UK format in the code and the filter works if I do
an "equal to " filter but I can't filter for a dates "greater than"
regardless of the format.

USIDNUMBER STARTDATE SURNAME FIRSTNAME
119509 02/04/2007 mmm aaa Aix-en-Provence AT Sales Consultant Sévilla
Aurélia lll ppp


"Ron de Bruin" wrote:

Only in the code use the US date format
No problem if the format in the worksheet is different

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"manfareed" wrote in message ...


"Ron de Bruin" wrote:

You can read this below the macro. Use the US mm/dd/yyyy date format

Use this to filter for all women born between 23 Feb 1947 and 7 May 1988 from the Netherlands and the USA
(column A, C and D in my example). I use two criteria in field 1 and 4 (2 is the maximum for AutoFilter)
rng.AutoFilter Field:=1, Criteria1:="=Netherlands", Operator:=xlOr, Criteria2:="=USA"
rng.AutoFilter Field:=3, Criteria1:="=F"
rng.AutoFilter Field:=4, Criteria1:="=02/23/1947" , _
Operator:=xlAnd, Criteria2:="<=05/07/1988" ' Use always the US mm/dd/yyyy format



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"manfareed" wrote in message ...
Hi,

Sorry but I can't see anything which is specific to my query.

Thanks,

Manir

"Ron de Bruin" wrote:

Hi manfareed

See the tips below this macro
http://www.rondebruin.nl/copy5.htm#AutoFilter


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"manfareed" wrote in message ...
Hi ,

I have data in 13 columns and the second column contains the "start dates".
The "start dates" are in the following format "26/09/2007" etc. [UK Date
format].
I need to filter for dates greater than "12/01/2002". So far I have been
unsuccessful. I have tried to reformat the "start date" column as date and as
text but I still cannot filter for "greater than" via the autofilter.
"12/01/2002" is not an actual date in the " start date" column.

I don't mind if I have to use a macro to get the required result.

Thanks


Hi Ron,

I can't get it to filter for anything "greater than " but otherwise it
works. Also there is a lot of data in UK format. Is there a way to convert
them to US format i.e. from
dd/mm/yyyy to mm/dd/yyyy.

Thanks