HYCH.
The code below works for what i want, BUT !!
In the worksheet "Lists" i want the 1st combobox to show the values as
hh:mm but am getting the display as decimal, where do i format the
code below to show "hh:mm"
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("A1:A12")
With Me.ComboBox1
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart
For Each cPart In ws.Range("B1:B7")
With Me.ComboBox2
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart
Me.ComboBox1.Value = ""
Me.ComboBox2.Value = ""
Me.ComboBox1.SetFocus
End Sub
Steve
Dave Peterson - 22 Oct 2007 21:28 GMT
If the cells are formatted correctly:
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Text
or apply the format you like:
.List(.ListCount - 1, 1) = format(cPart.Offset(0, 1).Value, "hh:mm")
> HYCH.
> The code below works for what i want, BUT !!
[quoted text clipped - 27 lines]
>
> Steve

Signature
Dave Peterson
K1KKKA - 22 Oct 2007 22:39 GMT
> If the cells are formatted correctly:
> .List(.ListCount - 1, 1) = cPart.Offset(0, 1).Text
[quoted text clipped - 39 lines]
>
> - Show quoted text -
Cheers Dave, sorted
Steve