VBA & Macro Problems

Fix Excel VBA Date Format Showing Month and Day in the Wrong Order

Nimra MalikNimra Malik Dec 2, 2026 869 views

Question details

The user needs an Excel VBA macro to display dates in day/month/year order without swapping the day and month.

Fix Excel VBA Dates Showing the Month and Day in the Wrong Order
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the macro

In Excel, press Alt+F11 to open the VBA editor, then open the module containing the macro that writes the date.

2
Write a real date value

Replace the code that writes formatted date text with: ThisWorkbook.Sheets(1).Range("R20").Value = Date. Change the sheet and cell references if needed.

3
Set the display format

Add this line after the value assignment: ThisWorkbook.Sheets(1).Range("R20").NumberFormat = "dd/mm/yyyy".

4
Run and check the macro

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.

Write a Date Value and Set the Cell Format in VBA
For a specific date: Use DateSerial(year, month, day) instead of Date. For example, DateSerial(2022, 8, 1) creates August 1, 2022, which displays as 01/08/2022 with the specified format.
Free Microsoft Office alternative

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.

Format and view spreadsheet dates in WPS SpreadsheetsCompatible with Microsoft Excel XLSX filesFamiliar spreadsheet interface for an easier transitionFree and lightweight for everyday Office tasks
microsoft office alternative - wps office

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.