ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LisBox Column Width (https://www.excelbanter.com/excel-programming/357828-lisbox-column-width.html)

Abdul[_2_]

LisBox Column Width
 
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


Tom Ogilvy

LisBox Column Width
 
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.

--
Regards,
Tom Ogilvy



"Abdul" wrote:

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



Abdul[_2_]

LisBox Column Width
 
Thanks for your reply..

unfortunately I could not get the idea?


Tom Ogilvy

LisBox Column Width
 
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.

--

"Abdul" wrote:

Thanks for your reply..

unfortunately I could not get the idea?



Abdul[_2_]

LisBox Column Width
 
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?



All times are GMT +1. The time now is 02:59 PM.

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