Macro to convert dates to dd/mm/yyyy

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,595
Office Version
  1. 2021
Platform
  1. Windows
I have imported data that appears as yyyy/dmm/dd for eg 2017/10/31 in Col L on sheet Sales Data


I would like a macro to convert these to format dd/mm/yyyy for eg 31/10/2017


Your assistance is most appreciated
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
can you just change the cell formatting under custom to be dd/mm/yyy or with a macro Selection.NumberFormat = "dd/mm/yyyy"
 
Upvote 0
I have formatted the column as dd/mm/yyyy , but nothing happens i.e format does not change

See Sample Data


Excel 2012
J
22018/07/08
32018/07/08
42018/07/08
52018/07/08
62018/07/08
72018/07/11
82018/07/11
92018/07/11
102018/07/11
112018/07/11
122018/07/11
132018/07/11
142018/07/11
152018/07/11
Demos
 
Last edited:
Upvote 0
try this

convert your dates to a number and no .00's looking at just the serial number save it and then convert it back to a date using the custom and see if that works.
 
Upvote 0
Thanks for the reply and your input. I used text to data DMY on the raw data and it works perfectly
 
Upvote 0
glad it worked. thank for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top