I need a macro to convert my date formats into a custom layout.

  • Thread starter Thread starter Martyn
  • Start date Start date
M

Martyn

I've got a spreadsheet which collects dates on a spesific column (D2:D100)
in the format of "dd.mm.yyyy". (e.g.: 12.08.2003). I need to have a button
on this sheet that will convert these dates into the format of "dd/mm/yyyy"
(e.g.: 12/08/2003). Is this possible?
TIA
 
Martyn

Sub Macro2()
Columns("D:D").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub

Regards

Trevor
 
Hi
why don't you just change the format of these cells ('Format - Cells -
Custom' or 'Format - Cells - Date'). If you want a button you may
record these steps (Tools- Macros - Record Macro') and assign a button
to this macro
 
Frank, I see your point. But according to the nature of work, new dates will
keep coming into the workbook "generally" in the old "dd.mm.yyyy" format.
Thus IMHO having a button to solve this problem whenever required seems both
practical a logical.
Thanks for your suggestions anyway...
Martyn
 
Back
Top