View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Date in YY/MM/DD format

You can probably adapt this for your needs

Dim tmp As String
With ActiveCell
tmp = Trim(Replace(.Value, "DIN", ""))
.Value = DateSerial(Right(tmp, 2), Mid(tmp, 3, 2), Left(tmp, 2))
End With


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Alastair79" wrote in message
...
I have a general formated cell with the following in:-

DIN 060416 (the numbers change day to day of course)

In a Macro I need to remove the "DIN" part which I can do, but as soon as

I
do this it alters the format to number and shows it 60416 which if you try
and date format is completely wrong.

I need it to be 06/04/16. Any help would be much appriciated and as you

can
prob tell I am rubbish on Excel ;) Alastair.