Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I had this working (I thought) but for some reason it's stopped. I am entering the columnwidths of a listbox in VBA . I used List1.ColumnWidth="1;1"

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The ColumnWidth property specifies the width of a control in datasheet view. If you want to specify the width of columns in a list box or combo box, use ColumnWidths instead of ColumnWidth.

    In VBA, the default unit for column widths is twips, where 1440 twips = 1 inch. So if you want to set the column widths to 1 inch each, you should use

    List1.ColumnWidths = "1440;1440"

    Alternatively, explicitely specify inches as unit:

    List1.ColumnWidths = "1 inch;1 inch"

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Many thanks Hans, that sorted it. Don't know why it worked in the beginning, but at least it's now done the correct way. Best regards

Posting Permissions

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