LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default CDate Problem


Hello!
I have a problem converting string to date.

Working with Excel 2003, function Cdate works fine. If I do

..Range(myCell).Value = CDate("22/02/2005")

in the cell is shown 22/02/2005 (My regional configuration is
dd/mm/yyyy).

But if I use this program with Excel XP, the function doesn't work
correctly because it tries to make a date which is the day 2 of the
month 22.
I've tried to do MiDate = CDate(#2/22/2005#) but it doesn't work.

The solution in office XP is:
..Range(myCell).NumberFormat = "dd/mm/yyyy"
..Range(myCell).Value = "22/02/2005"

But this solution doesn't work in Excel 2003!!!

The problem is that I need a solution working for both versions. Is it
possible to know the version of Excel?

Can anyone help me please???

Thank-you!!!


--
sil0000
------------------------------------------------------------------------
sil0000's Profile: http://www.excelforum.com/member.php...o&userid=25460
View this thread: http://www.excelforum.com/showthread...hreadid=389020

 
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
CDate and IsDate Geoff Excel Programming 3 June 4th 05 02:20 PM
CDATE issues Marcus Excel Programming 1 November 12th 04 10:02 AM
CDate cannot coerce value of IsDate(true)? tkstock[_4_] Excel Programming 1 November 1st 04 04:34 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM
What is the differance between cdate and ... Bruccce Excel Programming 3 August 7th 03 09:00 PM


All times are GMT +1. The time now is 09:02 AM.

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

About Us

"It's about Microsoft Excel"