Sub stringdate()
For Each c In Range("f8:f12")
c.Offset(, 1) = CStr(Format(c.Value, "yyyymmdd"))
Next c
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"Mike H" <(E-Mail Removed)> wrote in message
news:CF4D223F-D2B1-4912-AAB7-(E-Mail Removed)...
> Hi,
>
> Try this
>
> Sub stance()
> Dim MyRange As Range
> Dim LastRow As Long
> LastRow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
> Set MyRange = Range("A1:A" & LastRow)
> For Each c In MyRange
> c.Offset(, 1).Value = Format(c.Value, "yyyymmdd")
> Next
> End Sub
>
>
> Mike
>
> "ulfb" wrote:
>
>> Hi
>> One column contains excel dates, formatted like: 2009-11-09.
>> What I need is to programmatically create a new column containing text
>> only:
>> 20091109
>> Any help higly appreciated!
>>
>>