OzGrid

How to prevent listbox horizontal scrollbar

< Back to Search results

 Category: [Excel]  Demo Available 

How to prevent listbox horizontal scrollbar

 

Requirement:

 

The user is playing around with listboxes for the first time and can't work out how to prevent a horizontal scrollbar appearing in the event that Excel decides the text is too wide...

The data that the user is populating in the listbox is only a few characters long, but Excel seems to demand that the listbox be approximately 2.5 times the width of the text before it will stop forcing a scrollbar.

 

Solution:

 

Change the ColumnWidths in the listbox properties to something like 5pt.

 

Obtained from the OzGrid Help Forum.

Solution provided by jkc72001.

 

See also: Index to Excel VBA Code and Index to Excel Freebies and Lesson 1 - Excel Fundamentals and Index to how to… providing a range of solutions and Index to new resources and reference sheets

 

See also:

How to use VBA code to check interactions in the formula bar
How to use Excel VBA userform list box
How to use a UserForm: CheckBox Checked if Listbox column 5 text matched CheckBox text
How to search ListBox as the user types in TextBox

 

Click here to visit our Free 24/7 Excel/VBA Help Forum where there are thousands of posts you can get information from, or you can join the Forum and post your own questions.

 

 


Gallery



stars (0 Reviews)