VBA date in local format

opislak

Board Regular
Joined
Feb 28, 2017
Messages
61
Hello all,

As a European, my keyboard layout is set by default to show dates with '-' as in 11-06-2021 or jun-21
I would like to modify the '-' by a slash '/', to show 11/06/2021 or jun/21
The code I use doesn't work.
VBA Code:
            Range("A:A").NumberFormat = "dd/mm/yyyy  hh:mm"
            Range("B:B").NumberFormat = "mmm/yy"
this code does not modify the date. It still shows jun-21
Any help is welcome, thank you !
Patrick.
 

opislak

Board Regular
Joined
Feb 28, 2017
Messages
61
Insteresting, I see "Jun/21" on the DropBox site, even before I download the file.
So we are seeing different things. So it appears I cannot replicate your issue.
Dear Joe4,
No problem. Thank you very much for trying and searching. Much obliged.
Patrick.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

opislak

Board Regular
Joined
Feb 28, 2017
Messages
61
Opislak, as so obviously the slash is not used in your local date settings so the VBA format must be
Rich (BB code):
"mmm""/""yy"
Dear Marc L,
That works !!! Great, so easy... Thank you very much !!
Patrick.
 

Forum statistics

Threads
1,136,952
Messages
5,678,745
Members
419,782
Latest member
gc75150

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
Top