Fix Column width in spreadsheet control?!

W

Webtechie

I finally got data showing on my userform with a spreadsheet control!

Now the only thing I need to do is to figure out how to fix the columns
widths in the control to autofit.

I'd appreciate any help.


Thanks,

Toiny
 
J

JLGWhiz

I believe the default for ColumnWidths in the ListBox and the ComboBox is
for autofit, which will set the column width to the longest string in the
column, up to 72 points. If you want more spacing between columns then you
will have to set the width of the columns a little wider than the autofit.
You can set the ColumnWidths in the properties window while in the VB
editor, or using code per VBA help file under "ColumnWidths". Note the "s",
which differentiates between the worksheet ColumnWidth.
 

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