Fix Excel VBA Date Format Showing Month and Day in the Wrong Order
Question details
The user needs an Excel VBA macro to display dates in day/month/year order without swapping the day and month.

- Product
- Microsoft Excel
- Device & OS
- Windows
- Scenario
- A macro writes the current date to a worksheet on a computer using United Kingdom regional settings.
- Observed behavior
- A date intended as August 1 appears as January 8.
Identify the macro and the destination cell where the date is written. Check whether the macro writes a date value or a formatted text string, and only run macros from trusted sources.
Write a Date Value and Set the Cell Format in VBA
Use this approach to avoid locale-dependent text conversion and display the date in day/month/year order.
In Excel, press Alt+F11 to open the VBA editor, then open the module containing the macro that writes the date.
Replace the code that writes formatted date text with: ThisWorkbook.Sheets(1).Range("R20").Value = Date. Change the sheet and cell references if needed.
Add this line after the value assignment: ThisWorkbook.Sheets(1).Range("R20").NumberFormat = "dd/mm/yyyy".
In the VBA editor, place the cursor inside the macro and press F5. Return to the worksheet and check that the destination cell displays the current date in day/month/year order.

Work With Spreadsheets in WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format compatibility to help you move between applications. It does not fix Excel VBA behavior, so check macro support before migrating automated workbooks.

Frequently Asked Questions
Why can a VBA date have the wrong month and day?
If a macro writes a formatted date as text, Excel may interpret that text using a different date order. Write a date value with Date or DateSerial, then set the cell's NumberFormat.
Will changing the cell format correct an already swapped date?
No. NumberFormat changes how the stored value appears, not the date itself. Correct the value in the cell or macro first, then apply the desired format.
How do I enter August 1, 2022, without relying on regional settings?
In VBA, assign DateSerial(2022, 8, 1) to the cell's Value, then set its NumberFormat to "dd/mm/yyyy".
How can I keep the macro when saving the workbook?
In Excel, select File > Save As and choose Excel Macro-Enabled Workbook (*.xlsm) as the file type.




