Date format in userform

C

cutsygurl

I have a userform with a combobox that has dates that you can choose
from. The list of dates look correct but when you choose a date it
changes to the general number on the form. How can I change it so when
you choose the date it still looks like a date???
 
G

Guest

That is rather unfortunate, isn't it? I have a workaround, but it only works
if the Combobox.MatchRequired property is False: In the Combobox_Change
event code, put code like this:

Private Sub ComboBox1_Change()

ComboBox1.Text = Format(ComboBox1.Value, "mm/dd/yyyy")

End Sub
 
G

Guest

Hi, I have been experiencing the same problems with dates. I have a combo
box on a user form that links to a column on a worksheet containing a list of
dates. When I click on the combo box a list of dates in the correct format
appear. However, when I select a date it appears as a text field,

I tried inserting the code as described below but I haven't had any luck.
Has anybody any other ideas??
 
G

Guest

check your code

yours = ComboBox1.Text = Format(ComboBox1.Value, "mm/dd/yyyy")
should be = ComboBox1.Value = Format(ComboBox1.Value, "mm/dd/yyyy")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top