K
K1KKKA
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
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