I have created a workbook with a lot of userforms which is going to be used to collect answers about software configuration from my company's customers. I use multiple list boxes and comboboxes on each userform. Yesterday, I was working on one of the userforms and I ran it to see if something had worked and any listbox or combobox that i was populating from the code, as opposed to a sheet in the workbook, would not populate. Today, I got that same sheet to populate by using a "clear" button that I had configured. I put the same button in another worksheet with the same problem, and I did not populate the boxes. In reality, I want everything to populate with the available options on initialize, but that isn't happening. I created a brand new user form today and the first few times I ran it the boxes would populate, and then I left my computer for lunch and they would no longer populate on run. I have tried changing some of the code from the with combobox .AddItem "" etc to:
Private Sub boxfrequency_Initialize()
Dim freq As Variant, j As Integer
With Me.boxfrequency
.Clear
freq = Range(Cells(1, 1), Cells(15, 1)).Value
freq = Application.WorksheetFunction.Transpose(freq)
For j = 1 To UBound(freq)
.AddItem ListItems(i)
Next j
.ListIndex = -1
End With
End Sub
This worked the first few times, and again it doesn't work. I am pretty sure I've read hundreds of posting and not come across this one yet...
Private Sub boxfrequency_Initialize()
Dim freq As Variant, j As Integer
With Me.boxfrequency
.Clear
freq = Range(Cells(1, 1), Cells(15, 1)).Value
freq = Application.WorksheetFunction.Transpose(freq)
For j = 1 To UBound(freq)
.AddItem ListItems(i)
Next j
.ListIndex = -1
End With
End Sub
This worked the first few times, and again it doesn't work. I am pretty sure I've read hundreds of posting and not come across this one yet...