Displaying dd mmm yyyy

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,835
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
I'm connecting to Excel 2003 from Access 2007 to populate a worksheet created by a 3rd party program.

From Access I send
Code:
xlSh.Cells(iRow, 11).Value = Day(Now) & " " & MonthName(Month(Now), True) & " " & Year(Now)

This should result in dd mmm yyyy but Excel shows this as dd-mmm-yy I guess adhering to a preset date format.

Can I sort this somehow ? Thanks
 
Last edited:
I'm not too clear on what your requirement is here... but just a thought: if it only needs to *look* like what you want, and the actual value doesn't matter, then you could try a leading apostrophe in your code from post #1 :

Rich (BB code):
xlSh.Cells(iRow, 11).Value = "'" & Day(Now) & " " & MonthName(Month(Now), True) & " " & Year(Now)

Tai
 
Last edited:
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You have to use Control Panel to set the system default format for the short date.
1.In the search box on the taskbar, type control panel, and then select Control Panel.

2.Under Clock, Language and Region, click Change date, time, or number formats

3.Click Regional and Language Options.

4.In the Region dialog box, click Additional settings.

5.Click the Date tab.

6.In the Short date format list, click a format that uses four digits for the year ("yyyy").

7.Click OK.
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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