E
Ed
I have a table with a column of dates. All the dates are in the form of
"20050625" (yyyymmdd). I tried a few variations of Format to change this
to "25 Jun 2005" (dd mmm yyyy), but just couldn't get it. This is the code
I left off with - any suggestions?
Ed
Sub XX_ChgDates()
Dim rng As Range
Dim cll As Cell
Dim str1 As String
Dim str2 As Date
Dim str3 As Date
' Cells to be changed are selected
Set rng = Selection.Range
For Each cll In rng.Cells
str1 = cll.Range.Text
str1 = Left(str1, (Len(str1) - 2))
str2 = str1
str3 = Format(str2, "dd mmm yyyy")
cll.Range.Text = str3
Next cll
End Sub
"20050625" (yyyymmdd). I tried a few variations of Format to change this
to "25 Jun 2005" (dd mmm yyyy), but just couldn't get it. This is the code
I left off with - any suggestions?
Ed
Sub XX_ChgDates()
Dim rng As Range
Dim cll As Cell
Dim str1 As String
Dim str2 As Date
Dim str3 As Date
' Cells to be changed are selected
Set rng = Selection.Range
For Each cll In rng.Cells
str1 = cll.Range.Text
str1 = Left(str1, (Len(str1) - 2))
str2 = str1
str3 = Format(str2, "dd mmm yyyy")
cll.Range.Text = str3
Next cll
End Sub