litestream
Active Member
- Joined
- Jul 24, 2006
- Messages
- 323
I have 2 Comboboxes on a User Form. Both show the same information taken from the result of a formula in a worksheet cell. For demonstration purposes, both boxes show integers from 1 to 44.
Would it be possible to show the number 1 in the first box and 44 in the second when the form is loaded rather than just 2 blank boxes?
When the form is loaded, nothing is shown in either Combobox until the arrow is clicked.
Would it be possible to show the number 1 in the first box and 44 in the second when the form is loaded rather than just 2 blank boxes?
Code:
Private Sub UserForm_Initialize()
Label1.Caption = Sheets("Summary").Range("B16").Value
Label2.Caption = Sheets("Summary").Range("D16").Value
Dim i As Integer
Dim j As Integer
With Sheets("Summary")
With ComboBox3
For i = 1 To Worksheets("Summary").Range("L19").Value
.AddItem i
Next
End With
End With
With Sheets("Summary")
With ComboBox4
For j = 1 To Worksheets("Summary").Range("L19").Value
.AddItem j
Next
End With
End With
End Sub
When the form is loaded, nothing is shown in either Combobox until the arrow is clicked.