+ Reply to Thread
Results 1 to 5 of 5

User Form ListBox Column Widths - How to set widths for unknown number of columns

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Angry User Form ListBox Column Widths - How to set widths for unknown number of columns

    I am using UserForm_Initialize to populate a listbox with an array. I don't know how many columns the array will have. I want to:
    1. set the first column to 0 points (to hide the primary key column)
    2. and the rest (however many columns there are) to either default/autosize/49.95 pts(I don't care too much about the remaining column widths )

    How do I do this?

    This is where I am up to so far:
    Please Login or Register  to view this content.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,431

    Re: User Form ListBox Column Widths - How to set widths for unknown number of columns

    Please Login or Register  to view this content.
    If you want autosize widths then

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: User Form ListBox Column Widths - How to set widths for unknown number of columns

    Brilliant work. Just what I wanted.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: User Form ListBox Column Widths - How to set widths for unknown number of columns

    you may also just use
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: User Form ListBox Column Widths - How to set widths for unknown number of columns

    Quote Originally Posted by JosephP View Post
    you may also just use
    Please Login or Register  to view this content.
    It was that simple! Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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