ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Listbox Locked After Adding ListRange via VBA (https://www.excelbanter.com/excel-programming/398624-listbox-locked-after-adding-listrange-via-vba.html)

Ross Culver[_2_]

Listbox Locked After Adding ListRange via VBA
 
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



Ross Culver[_2_]

Listbox Locked After Adding ListRange via VBA
 
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



"Ross Culver" wrote in message
...
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




JLGWhiz

Listbox Locked After Adding ListRange via VBA
 
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.
"Ross Culver" wrote:

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




Ross Culver[_2_]

Listbox Locked After Adding ListRange via VBA
 
You are a whiz!

"JLGWhiz" wrote in message
...
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.
"Ross Culver" wrote:

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







All times are GMT +1. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com