Date Format Question

TR21Mark

Board Regular
Joined
Oct 30, 2004
Messages
240
I have several unbound textboxes on a form. They have date calculations in the control source of the textboxes. I have them set to 'Short Date' format.

This is the calculation I have in the textbox.

=DateSerial(Year([DateCode]), Month([DateCode])+1, Day([DateCode]))
(Please note that they each increment under Month +2,+3,+4 etc)

What I would like displayed in the textbox is this 'Apr-09', but what I have is 4/1/2009 because it is set to Short Date.

I went into properties of the controls and entered "mmm-yy" and when I opened the form the only thing that was showing is the actual mmm-yy letters.

Do I need to create a custom date format, or do I nest the Format function in the above calculation ( which I am not sure how to do)

Any help is much appreciated.

Thanks
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

TR21Mark

Board Regular
Joined
Oct 30, 2004
Messages
240
Disregard post


I was quotations in the format section under properties "mmm-yy"

I typed mmm-yy without quotations and it works perfectly like I need it too.

Thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,123,535
Messages
5,602,217
Members
414,513
Latest member
junbuggle

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