USA Text Date to UK Text Date

rsutton1981

New Member
Joined
Mar 9, 2016
Messages
47
Office Version
  1. 365
Platform
  1. Windows
Hi,

Part of a software that the company uses exports dates in USA text format. How do I convert this to a UK text date.

Ie 1st August 2017 is 42743 in USA but 42948 in the UK.

I have hundreds of dates across multiple sheets (dates are always in G18:10000 and H18:10000) so I need some VBA code to process.

I have an additional problem with this query. Sometimes there is not a date in column G (a quirk with the accounting software). in this case need the o in text being replaced with the same date in Column H.

Any help will be appreciated
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Well. Firstly 1/8/2017 (UK) and 8/1/2017 are the same date code (42948).
When Excel displays a date it does it based on the preferences set on your computer (ie UK or US format). But you can change the date format in individual cells or ranges. Try this and you'll see the display changing.

If your data is in TEXT format then that is NOT a date format. What you should do is convert it to a date using some string extraction. Use the formula =DATE(Year, month day)

If you want some code you'll need to detail exactly how the dates are formatted. Ie is it "8/1/17", "08/01/2017" etc
 
Upvote 0
Hi Stuiart,

I have found the error. The accounting software exports the date as a text line not date. I will try text to number formatting to see if it works.
 
Upvote 0
Part of a software that the company uses exports dates in USA text format. How do I convert this to a UK text date.

Hi, try this on one column and see it successfully converts your dates:

1. Select the single column and choose "Text to Columns" from the data tab.
2. Check Delimited and click next.
3. Uncheck all delimiters and click next.
4. Choose Date and select MDY from the dropdown and click finish.

If this works for your single column we can help you with some code to apply if to multiple columns across multiple sheets.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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