You could also name the ranges:
In the name box (far left on the formula bar) enter
C9:C63,C68:C110,B117:B166,B173:B187
Press <Enter>
While the cells are selected enter "RowSourceRange"
(without quotes) in the name box.
In the sub enter
Range("RowSourceRange") (*With* quotes)
instead of
Range("C9:C63,C68:C110,B117:B166,B173:B187")
--
Best Regards
Leo Heuser
Followup to newsgroup only please.
Leo Heuser said:
Hi Stift
One way to do it:
Private Sub UserForm_Initialize()
'Leo Heuser, 28-5-2004
Dim Cell As Range
Dim Counter As Long
Dim ListRange As Range
Dim ListRangeValue() As Variant
Set ListRange = _
ActiveSheet.Range("C9:C63,C68:C110,B117:B166,B173:B187")
ReDim ListRangeValue(0 To ListRange.Cells.Count - 1)
For Each Cell In ListRange.Cells
ListRangeValue(Counter) = Cell.Value
Counter = Counter + 1
Next Cell
Me.ComboBox1.List = ListRangeValue
End Sub