How to prevent text turning into date format

  • Thread starter Thread starter ylrino
  • Start date Start date
Y

ylrino

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
 
Hi Yltino,

Try something like:

Dim rng As Range

Set rng = Range("A1")

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top