Hi
I just want to know how to Autofit Column width of Listbox.
Please help!!!
Thanks
Thiru
Hi
I just want to know how to Autofit Column width of Listbox.
Please help!!!
Thanks
Thiru
This seems to get it pretty close:
![]()
Please Login or Register to view this content.
If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)
You can't do one thing. XLAdept
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin
But the list box is in Userform - how to do that? - Please Help
Thanks
Thiru
If its name is still "ListBox1" the code should still apply - but, is it the same width as the userform - if so, then maybe you should use "UserForm1" instead??
Getting Error Msg
This is the code that I have
Dim S As Single![]()
Please Login or Register to view this content.
S = UserForm1.OLEObjects("ListBox1").Width / 6
Columns("D:D").ColumnWidth = S * 1.077
Even I change the code - it doesn't work.
![]()
Please Login or Register to view this content.
Can you post a sample spreadsheet with your userform including the listbox?
Please find the attached.
Thanks
Thiru
Last edited by sthiru; 06-20-2013 at 02:39 PM.
Hi SThiru,
Your program trashed my system the first time I brought it up but subsequently I discovered that the list box width was 585.95 or something like that - when I ran my program on it it seemed to work - but I'm not sure now what you wanted.
BTW - I posted this response, or a similar one yesterday - I have no idea why it didn't take![]()
Its ok! I have found the solution - Below is the code for the people who searching for this.
![]()
Please Login or Register to view this content.
Last edited by sthiru; 06-24-2013 at 08:21 PM. Reason: Additional Information
Glad you got it!
Autosize list/combobox columns with this function. Optionaly autosize the list/combobox itself.
![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks