Display time in Combobox

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I have a Combobox that displays time values. My cells on the worksheet is set to custom as h:mm and the values are 24/hr clock. I have to convert the values to format(combobox1.value, "h:mm"). This works except that when I select "6:00:00 am" on the dropdown, is displayed as "0:25" and "12:00:00 PM" is displayed as "0:05".

Can someone help me figure this out?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi Dave,

You might be using a Form Control on a worksheet.

If you use an ActiveX control on a worksheet then you can use the ComboBox_Click event to reformat the displayed value immediately after it is selected.
 
Upvote 0
Hi Dave,

You might be using a Form Control on a worksheet.

If you use an ActiveX control on a worksheet then you can use the ComboBox_Click event to reformat the displayed value immediately after it is selected.

I am using an ActiveX control on a worksheet and my code is in the Combobox_Click event. All the values are fine with the exception of 6:00:00 AM and 12:00:00 PM.
 
Upvote 0
If you are using rowsource to link the list items, perhaps check that the values and formatting of those two cells is consistent with the others.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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