I'm using the below code to populate my ComboBox on a Userform but running into a little problem.
It does not list the sheets within the CB. But if I click on the Scroll Bar, all sheets are listed.
From there I can click on one of them and then it will appear within the CB.
If I click on the Scroll Bar again and choose another sheet, the first one is replaced by the second choice.
Don't know what's going on here.
Code:
Private Sub UserForm_Initialize()
Dim ws As Integer
For ws = 1 To Sheets.Count
ComboBox1.AddItem Sheets(ws).Name
Next
End Sub
It does not list the sheets within the CB. But if I click on the Scroll Bar, all sheets are listed.
From there I can click on one of them and then it will appear within the CB.
If I click on the Scroll Bar again and choose another sheet, the first one is replaced by the second choice.
Don't know what's going on here.