Combo Box - format output as time

  • Thread starter Robert Mark Bram
  • Start date
R

Robert Mark Bram

Hi All,

I created a combo box that is linked to a set of cells that contain
numbers but for which I have selected to format as time i.e. the cells
look like this:

12:00 AM
12:30 AM
1:00 AM
1:30 AM
2:00 AM
2:30 AM

My problem is that when I select a value with the combo box, it
displays them as the number, not as a formatted time and I cannot see
which property to edit on the combo box to have the output formatted as
time.

Any help would be most appreciated!


Rob
:)
 
D

Dave Peterson

How about removing that link to the range and just add the values to the
combobox.

dim myCell as range
dim myRng as range

with worksheets("Sheet1")
set myrng = .range("a1:A10")
end with

with me.combobox1
for each mycell in myrng.cells
.additem mycell.text
'or
'.additem format(mycell.value, "hh:mm AMPM")
next mycell
end with
 
Top