Combobox number formats

S

Steve

HYCH
Am using the code below, to pull back the a list of Times (format
hh:mm)

But still shows as decimal numbers


any help please !!!


Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("Lists")
For Each cPart In ws.Range("C1:C88")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = Format(cPart.Offset(0, 1).Value,
"hh:mm")
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub


Steve
 
S

Smallweed

The .AddItem line is what's adding the text to the combo box - shouldn't this
be where you put Format(cPart.Value, "hh:mm")?
 
S

Steve

The .AddItem line is what's adding the text to the combo box - shouldn't this
be where you put Format(cPart.Value, "hh:mm")?









- Show quoted text -

What a star, of course, thanks Small

:)
 
J

JE McGimpsey

See one answer in microsoft.public.excel

Please don't post the same question to multiple newsgroups. It tends to
fragment any answers you get, and it potentially wastes the time of
those responding to questions that have already been answered in another
group.
 
S

Steve

See one answer in microsoft.public.excel

Please don't post the same question to multiple newsgroups. It tends to
fragment any answers you get, and it potentially wastes the time of
those responding to questions that have already been answered in another
group.







- Show quoted text -

Sorry JE,

Misc, seems to be very slow just recently, and meant to poast it here.

apologies
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top