+ Reply to Thread
Results 1 to 2 of 2

Problem with setting column widths in forms

  1. #1
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Question Problem with setting column widths in forms

    I'm trying to use a listbox in a form and set the columns up so that they are the same widths as the sheet, so nothing gets truncated in the form. On the sheet, they are set up to Autofit. I have added code to get the column widths for each column on the sheet. The column widths on the sheet are 10, 39, 13, and 10. I am then trying to bring those columns of data from the sheet into the listbox. When I set the .ColumnWidths for the form equal to 10;39;13;10, it does not display correctly in the form. The columns are way to small. Is there a way to do this to base it off the column width on the sheet so nothing gets truncated?

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Problem with setting column widths in forms

    As far as I know there's no direct relationship between the columnwidth in a sheet and the columnwidth in a listbox in a userform. (the fonts may differ etc.).

    If you set the Listbox's property columncount to 4, wihtou specifying de columnwidts the listbox should show the columns correstly, but probably the listbox widt isn't correct. So the only thing you have to do is to adjust the Listbox.Width value.

    After having done that, you can experiment with columnwidths and listbox.width ( if you have some spare time...)



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1