Make Dtpicker and combobox the same date

Excelnewbie001

Board Regular
Joined
Jan 25, 2017
Messages
79
Need some help from the excel gurus. How would I get that I get my Combobox2 and DTPicker3 have the same date with otherwords if I select the date in the combobox make it automatically select the date on the Datepicker DTPicker3

I tried this but it doesnt work

Code:
DTPicker3.Value =Combobox2.Value

My format on my date and my Combobox are the same in this format 17/11/16 -YY/MM/DD. Should I set this on the form initialize or on the DTPicker change ?

Thank you for any help .....
 
Is combobox2 a list of dates? How is that combobox populated?

I think this might be easier if you can upload your file to a file sharing site and post the link here so I can take a look.

If that's not doable then please post the code that shows how you populate combobox2.

CORRECT....Its a column A in a worksheet thats dates only -I tried changing the whole column dates format to *01/03/14 but that also dont work. I am absolute sure its a text formatting issue. Thanks for the code you supplied that works like a charm -thank you for your help with that :) :)
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
SRzSqB7.jpg
 
Upvote 0
Ok, I suspect that you are using the rowsource property to populate combobox2 like this:

Code:
ComboBox2.RowSource = "A2:A26"

which will not maintain the formatting from the cells.

If this is the case, try using the following instead:

Code:
ComboBox2.List = Range("A2:A26").Value

If you have the rowsource property set in the properties list of the combobox, clear it out and put the above (2nd) code in the UserForm_Initialize event.

Regards,

CJ
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,522
Messages
6,131,146
Members
449,626
Latest member
Stormythebandit

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