Combox Date format Issue

User avatar
chamdan
3StarLounger
Posts: 372
Joined: 17 Dec 2013, 00:07

Combox Date format Issue

Post by chamdan »

Hi,

Enclosed is a workbook sample, I need to show the date value in the Combobox formated as "mm/dd/yyyy". I used Format as shown bellow:

Code: Select all

If IsDate(.Value) Then .Value = Format(ComboBox1.Value, "mm/dd/yyyy")
But I get instead of 04/16/2014 I get 41745

Regards,

Chuck
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combox Date format Issue

Post by HansV »

What do you want to use the combo box for? Its dropdown list is empty, so there's not much you can do with it.

I'd avoid ActiveX combo boxes - they cause lots of problems. If possible, use a data validation dropdown, or else a Forms combo box.
Best wishes,
Hans

User avatar
chamdan
3StarLounger
Posts: 372
Joined: 17 Dec 2013, 00:07

Re: Combox Date format Issue

Post by chamdan »

Hi Hans,

I was just checking why the format does not work. I do not want to use it but was curious to see how thie would work.

Thanks

User avatar
HansV
Administrator
Posts: 78457
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combox Date format Issue

Post by HansV »

The problem is that the combo box sees the underlying value of the linked cell, not its format.
Moreover, the value of the combo box is treated as text, not as a date.
Again, it's better to avoid using an ActiveX combo box.
Best wishes,
Hans

User avatar
chamdan
3StarLounger
Posts: 372
Joined: 17 Dec 2013, 00:07

Re: Combox Date format Issue

Post by chamdan »

:thankyou:
I will follow your sugestions.

Thanks for the tip.

Have yourself a great day!

Chuck