display date instead of number

RPT_22

Board Regular
Joined
Sep 18, 2012
Messages
98
Hi

I am using a combobox on my userform to select a date
The combobox currently has 3 options for dates:
18/11/2021
19/11/2021
20/11/2021
The combobox look at a sheet which has the 3 dates [cells are formatted as date]
=today()-2
=today()-1
=today()
The issue i have is the dates are displayed correctly in the userform combobox but when i select a date such as 20/11/2021 it is displayed as 44520 in the combobox but does transfer onto a sheet as a date
How do i fix this so the actual date is displayed in the combobox?

Other option: Is there a vba code for displaying the dates in the userform combobox which uses vba code therefore no need to look at another sheet for the dates

Thanks
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Just Check
Untitled.png
 
Upvote 0
Hi

Yes these are correctly labelled

If i remove the vba code from post #2 then the userform opens with no error

Thank you
 
Upvote 0
I get a Run-time error `70`
Permission denied

Thank you
For this error try clearing before populating

VBA Code:
Private Sub UserForm_Initialize()
Me.ComboBox1.rowsource = ""
Me.ComboBox1.List = Application.Transpose(Sheets("sheet1").Range("N1:N3").Value)
End Sub
 
Upvote 0
Solution
For this error try clearing before populating

VBA Code:
Private Sub UserForm_Initialize()
Me.ComboBox1.rowsource = ""
Me.ComboBox1.List = Application.Transpose(Sheets("sheet1").Range("N1:N3").Value)
End Sub
Hi,

Yes this solve the error....thanks

What would have caused the error:
Run-time error `70`
Permission denied

Thank you
 
Upvote 0
Hi,

Yes this solve the error....thanks

What would have caused the error:
Run-time error `70`
Permission denied

Thank you
Usually caused when rowsource has already been set
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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