View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Steven B Steven B is offline
external usenet poster
 
Posts: 14
Default Date to Text conversion

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