LisBox Column Width

A

Abdul

Hello All,

How to make a UserForm ListBox Column Widths to Auto Size?
Or
the ListBOx Column width be the same widths of the Columns in the
RowSourse ?


TIA

Abdul
 
T

Tom Ogilvy

You would need to set the columnwidths property using code.


See the VBA help for msforms for details. You will probably want the
column width in points.

Activecell.entirecolumn.Width

will give you the column width in points as an example.
 
T

Tom Ogilvy

consult the MSforms VBA help on columnwidths. Learning to use the help
feature will pay you dividends in the future. It really isn't complex.

If you can't get it, what do you need that will help you get it.
 
A

Abdul

Thanks,

I know it is easy to define the width of each column in a list box by
putting the value there.
What I am looking for is to get code for doing that based on the width
of the columns in the range or auto width for all columns sice the
rowsourse range column width are auto. It is very easy to make a range
EntireColumn.AutoFit. But is there a way like this for listbox column
width too?
 

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