Why is Excel changing the date I enter to American style?

Ingrid_SM

New Member
Joined
Jul 21, 2021
Messages
20
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have a workbook with a field to enter a date in format dd-mmm-yyyy.
If the day is lower than 13, it takes the day as the month and the month as the day and gives me the date in the same format dd-mmm-yyyy but with the date that would result in American style.
For example, I want to enter 11 (day) / 05 (month = May) / 2021. When I do enter, I get 05 (day) - November - 2021.
If I enter the date when the day is higher than 12, it does it correctly. For example: I enter 13 (day) / 05 (month = May) / 2021. It gives me 13-may-2021.
In cell format, I have: Regional configuration = Spain.

View attachment 43217

In Control Panel / Region, I have Format = Spanish too...

View attachment 43218

What's wrong?

Thanks in advance!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Welcome to the Board!

In Control Panel / Region, I have Format = Spanish too...
Did you scroll down further in those Regional Setting to the "Regional format data" section, and update the "Short date" setting?
 
Upvote 0
If by "field" you mean a textbox in a userform, then you need to use CDate when assigning it to a cell.
 
Upvote 0
Welcome to the Board!


Did you scroll down further in those Regional Setting to the "Regional format data" section, and update the "Short date" setting?
Hi Joe4,

Thanks for the welcome and for your answer!

This is what I have there:
1626880288276.png
 
Upvote 0
What happens if you open a brand new workbook and try it on that?
If it works properly there, then that means that there is something with that particular existing workbook.
 
Upvote 0
On a brand new workbook, it works fine.

I copied the cell from the new workbook and pasted it on the one I have the problem with, and it keeps changing it... :(
 
Upvote 0
Hi Alex,

It's an .xlsm

The problem is only in one sheet. The rest of the sheets of the workbook work fine.
 
Upvote 0
Right-click the tab for that worksheet, and choose View Code. Is there any code shown in the window that appears (probably a Worksheet_Change event routine)?
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

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