What is the VBA to convert a cell to the Australian date format

dpaton05

Well-known Member
Joined
Aug 14, 2018
Messages
2,375
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
What is the VBA to convert a cell to the Australian date format of dd/mm/yyyy?
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Code:
Range("A1").NumberFormat = "dd/mm/yyyy"
 
Upvote 0
How would I code in the change of the number format for a table column (A) instead of a range? This is a line of code I tried to write and put in the worksheet_open sub:

Code:
Worksheets("NPSS_quote_sheet").ListObjects("NPSS_quote").ListColumns(1).Range.NumberFormat = "dd/mm/yyyy"

Was I close?
 
Upvote 0
I used the formula provided Scott, but it only converts the date once it is entered. By that I mean that I enter 1/23/19 (US format) into excel and it converts it to 23/1/19(Aus format). I want it to enter the date, 23/1/19 and for it to still be a date format as I have other cells that depend on it and they give me the #Value error if I try to enter the date as 23/1/19. If I enter the date as 1/23/19 it works fine but that's not what I want.
 
Upvote 0
Hello,

From what you are saying, you should close Excel and check your Windows Regional settings ... which are in fact used by all Office Applications ... :smile:

Hope this will help
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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