Home » excel » Adjust listbox to display string longer than listbox width using Excel VBA

Adjust listbox to display string longer than listbox width using Excel VBA

Posted by: admin May 14, 2020 Leave a comment

Questions:

In my listbox the strings are longer than the listbox width.

I cannot change the listbox width because of the already made up surface design:

enter image description here

Is there a VBA property for the listbox to:

break the string in half and display it on more than one line

or

scroll horizontally, to see the whole string

If there’s not that kind of property, I’d like to know of other ideas.

How to&Answers:

The ListBox is single line only and does not support line breaks.

If it is an ActiveX then it has a property called ColumnWidths. Set it to something bigger like 500 and you will see a scrollbar at the bottom of the ListBox.