View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default How to prevent text turning into date format

Hi Yltino,

Try something like:

Dim rng As Range

Set rng = Range("A1")

With rng
.Value = CStr(Int(.Value))
End With


---
Regards,
Norman



"ylrino" wrote in
message ...

Hi all, i have been trying write a marco to extract the date portion
from date:time. The problem is the latter(date:time) is in string
format and when i used the left() function to extract the date, it
automatically converts into date format. How can i prevent this??
Thanks for your help.


--
ylrino
------------------------------------------------------------------------
ylrino's Profile:
http://www.excelforum.com/member.php...o&userid=34883
View this thread: http://www.excelforum.com/showthread...hreadid=546279