View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leo Heuser[_2_] Leo Heuser[_2_] is offline
external usenet poster
 
Posts: 111
Default Variable Type - help me to solve this

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.

"choco140" skrev i en meddelelse
om...
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