Listbox Locked After Adding ListRange via VBA

R

Ross Culver

I have a listbox whose listrange is set via vba. Upon opening the workbook,
the list is set fine; however, when you click on it, no items can be
selected, nor can you scroll the list. The listbox is locked. If I click
the 'Design Mode' button from the Controls Toolbox toolbar to go to design
mode and then click it again to exit design mode, the listbox works.

Is there property that I can set to free up this listbox? Some sort of
application.designmode = false, or something?

Thanks,

Ross
 
R

Ross Culver

Here's my applicable code:

Private Sub Workbook_Open()
Dim X As Long, Y As Long
X = 1
Y = 0
Dim l As ListBox
Do While Sheets("CustomerList").Range("A" & X).Value <> ""
Y = Y + 1
X = X + 1
Loop
Sheets("Report").ListBox1.ListFillRange = "CustomerList!$A$2:$B$" & Y
End Sub
 
J

JLGWhiz

Be sure the enabled property = true
and make sure you are not in design mode.
Is it set to multiselect or single
Bound Column = ?
You probably need to read up on list box in VBA help.
 
R

Ross Culver

You are a whiz!

JLGWhiz said:
Be sure the enabled property = true
and make sure you are not in design mode.
Is it set to multiselect or single
Bound Column = ?
You probably need to read up on list box in VBA help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top