View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Michael Koerner Michael Koerner is offline
external usenet poster
 
Posts: 164
Default Date to Text conversion

All this did was change 25-Jul-1936 to 25/07/1936 thanks.

--

Regards
Michael Koerner


"Steven B" wrote in message
...
On Jul 28, 3:58 pm, "Michael Koerner" wrote:
I have a sheet with a two columns containing dates. Sometimes it is the
full
date as an example 25-Jul-1936, or Jul-1936 or 1936 I would like to be
able
to convert that to text and maintain the same face value. Is that possible
with some sort of macro?

--

Regards
Michael Koerner


Sub DateText ()
Dim DtStr as String
Dim Rng as Range
Dim R as Range

Set Rng = Range("A:B" NOTE: REPLACE WITH RANGE CONTAINING DATES)

For each R in Rng
DtStr = R.value
r.NumberFormat = "@"
r.value = DtStr
DtStr = ""
Next R

End Sub

Untested code, please backup your work before applying.


Steven