Userform Listbox and combobox will not populate after first launch

emilydrue

New Member
Joined
Apr 4, 2012
Messages
1
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...
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,217,465
Messages
6,136,830
Members
450,026
Latest member
Thhoney

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top