Mix of US and UK dates - how to fix?

TheWennerWoman

Active Member
Joined
Aug 1, 2019
Messages
270
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have inherited a file which has a mixture of US and UK dates - the locale of this system is UK.

So I have data like 31/03/2020 but also 2/28/2020. The US dates are aligned to the left and the UK ones to the right.

How do I fix? I've read about text to columns, formatting the cells and stuff like that but none of it works.
 
As a reminder .Formula = .Value2 converts automaticly US dates to local dates and formats the cells as Date as well …​
Indeed it does! Thanks for that new insight!

Maybe OP needs like below as a code.

VBA Code:
Sub Conv_Date2()
Application.ScreenUpdating = False
Lastrow = Range("D" & Rows.Count).End(xlUp).Row
Range("D2:D" & Lastrow).Formula = Range("D2:D" & Lastrow).Value2
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Yes it's a well known solution since last century as VBA knows only US text dates !​
Another trick with dates as text in the local date format : use FormulaLocal - even Value - instead of Formula …​
 
Upvote 0

Forum statistics

Threads
1,215,227
Messages
6,123,743
Members
449,116
Latest member
alexlomt

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