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: 313
Default String converted to date

I have the string '1/1/05 in cell A1. When I execute the following code:

Range("A2").Value = Range("A1").Value

VBA converts the string to a date (i.e., number), which is not what I want.

I've tried

Range("A2").Value = Cstr(Range("A1").Value)

and even passing the value through a string variable, but the result is the
same. If the string is _1/1/05, then there is no problem. Ideally, I'd like
the contents of A1 to be a date and have it converted to a string when placed
in A2, but that seems too much to ask if I can't even copy a string from A1
to A2. Help appreciated.

Using Excel 97

Tony


 
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 converted to days wilecoyote Excel Discussion (Misc queries) 2 September 15th 08 08:11 PM
Serial Numbers converted to text string JGG Excel Worksheet Functions 3 September 15th 06 05:59 PM
Date converted to Text Number Mari Excel Discussion (Misc queries) 6 July 29th 06 03:15 AM
Date values are converted to formulas Al B Excel Discussion (Misc queries) 1 March 11th 06 02:09 PM
Text is being converted to Date kbreiss Excel Worksheet Functions 4 November 16th 05 10:09 PM


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

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"