List Box Time Format

197574

New Member
Joined
Feb 3, 2005
Messages
7
I have a lisbox in a userform that has a list of times which are pulled from the excel worksheet. When the user selects the time of choice I get the decimal value for the time selected not the formatted time I would like. I'm probable missing something easy any help on the formatting would be greatly appreciated.

Thanks

Mike....
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

CraigM

Active Member
Joined
Feb 27, 2003
Messages
320
Are you populating the listbox with the Row Source property, or the AddItem method?

For the latter, use something like this:

Me.ListBox2.AddItem Format(Sheet1.Cells(n, 1), "h:mm")
 

197574

New Member
Joined
Feb 3, 2005
Messages
7
Listbox Time Format

I am using a ComboBox instead of a listbox. Sorry for the error. I messed with the line of code a litte and still I'm having trouble. Thanks for the reply...

Mike....
 

Watch MrExcel Video

Forum statistics

Threads
1,123,482
Messages
5,601,920
Members
414,482
Latest member
morkar

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
Top