Variable Type - help me to solve this

C

choco140

A1 content is '02/9085 but when I run the under mentioned program I
always get 01/02/9085 (feb-85), can anybody pls help me to keep the
data the way they are.

Sub Test()
Dim a As String
a = Range("A1").Value
Range("A1").Value = a
End Sub
 
L

Leo Heuser

One way:

Sub Test()
Dim a As String
a = Range("A1").Value
Range("A1").Value = "'" & a
End Sub

"'" : single quote between 2 doouble quotes.

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.
 

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

Top