ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to prevent text turning into date format (https://www.excelbanter.com/excel-programming/362646-how-prevent-text-turning-into-date-format.html)

ylrino

How to prevent text turning into date format
 

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

--
ylrin
-----------------------------------------------------------------------
ylrino's Profile: http://www.excelforum.com/member.php...fo&userid=3488
View this thread: http://www.excelforum.com/showthread.php?threadid=54627


Norman Jones

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





All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com