LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Cell Date and Listbox Date formats

Try using CDate on your cell values in the code.
CDate recognizes date formats according to the locale setting of your
system. The correct order of day, month, and year may not be determined if
it is provided in a format other than one of the recognized date settings.
In addition, a long date format is not recognized if it also contains the
day-of-the-week string.

If .Cells(myrow, 4).Offset(, -3).Value < "" And CDate(.Cells(myrow,
4).Offset(, -3)).Value = ListBox1.Value And _
ListBox2.Value = CDate(.Cells(myrow, 4).Offset(, 3)).Value And _
ListBox4.Value = CDate(.Cells(myrow, 4)).Value Then '

untested, but some combination should get you what you want.

Mike F


"Corey" wrote in message
...
50% working.One date is formatted in the sheet as : 22/9/08, and is
displayed in the listbox as : 9/22/08, but allows the procedure to return
a CORRECT result as expected.

BUT,
another date is formatted in the sheets as : 11/12/08, and is displayed in
the listbox as : 12/11/08, but doe not allow the procedure to return as
correct result as it SHOULD.

Corey....

"Jim Cone" wrote in message
...
You have to format the dates before you add them to the ListBox.
Also, have you checked for extra spaces in the ListBox text?
--
Jim Cone
Portland, Oregon USA



"Corey"

wrote in message
Thanks for the reply Jim, but i am still get get a result.
If possible i really need to FORMAT the Listbox to be : ddd dd mmm yy
Is that possible ?
Corey....






 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Dealing with date formats on expiration date bliten_bsas Excel Programming 1 October 4th 07 08:47 PM
The Cell formats keep changing itself from text to date Hervinder Excel Discussion (Misc queries) 2 November 16th 06 03:56 PM
date formats Steve Excel Discussion (Misc queries) 4 November 10th 06 04:44 PM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"