Converting dates in the appropriate format

Nelson78

Well-known Member
Joined
Sep 11, 2017
Messages
526
Office Version
  1. 2007
Hello everybody.

In importing data from an external agent, I have to deal with the following situation:

https://imgur.com/a/oU9GE8j

I have to use, preferably, the format dd/mm/yyyy.

But the dates in the yellow cells are not correct, and they are not handleable in a usual way.
I mean: they are respectively 3rd October 2017, 6th Novembre 2015 and 1st July 2015, but Excel "reads" 10th March 2017, 11th June 2015 and 7th January 2015. I realize this in performing differences beetween dates (for instance today - date).

I need a vba solution to adjust all the values.

Thank you in advance.
 
Last edited:

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
You could loop through the cell group and run something like:

Code:
Range("a1").Value = VBA.Format(Range("a1").Value, "dd/mm/yyyy")
 
Upvote 0
You could loop through the cell group and run something like:

Code:
Range("a1").Value = VBA.Format(Range("a1").Value, "dd/mm/yyyy")

Yes: the tests I've performed so far are all positive.

Thank's a lot.
 
Upvote 0

Forum statistics

Threads
1,216,940
Messages
6,133,619
Members
449,820
Latest member
Johno1974

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