Cell date as custom date format

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,

I am trying to get the date in cell R14 like this 07-03-2023

Looking in the properties format date & custom options i dont see this.#
I can see 07\03\2023 but i am then unable to save worksheet because of the \\\
I also see DDMMMMYY but that then displays 07-Mar-2023

Is there a VBA way to display like so 07-03-2023

Thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
if it is a real date and note text
to check, change the format to general and you should see a number

if a number
then
format - custom - and type in
DD-MM-YYYY

and will format as you want

I'm a little concerned its strange that DDMMMMYY did not show as
07march23

hopefully the different formats will show in xl2bb

Book1
ABCD
1normal defaultnumberddmmmmyywith dash
23/7/234499207March2307-03-23
Sheet1
 
Upvote 0
For the cell in question should i be doing this.

=TODAY()

Then format that cell as custom & type in DD-MM-YYYY
 
Upvote 0
if you want to
or type in a date

so long as it changes to a number when format as general - then its a real date

i have change the row 2 to use today(), and change the dd-mm-yy to dd-mm-yyyy as you asked to show 2023 not just 23

Book1
ABCD
1normal defaultnumberddmmmmyywith dash
23/7/234499207March2307-03-2023
Sheet1
Cell Formulas
RangeFormula
A2:D2A2=TODAY()
 
Upvote 0
Solution

Forum statistics

Threads
1,215,064
Messages
6,122,942
Members
449,094
Latest member
teemeren

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