+ Reply to Thread
Results 1 to 14 of 14

Multi Column ListBox

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Multi Column ListBox

    I am not grasping how to setup a multi column listbox (2 columns).
    Please Login or Register  to view this content.
    Ref: For example:
    Please Login or Register  to view this content.
    The above Case I want the first column to be "u" with a specific font (use wingdings for examples, I will substitute it later) and the second column to be "(Straigtness)" with the Arial font.
    Can this be done?
    ListBox4 is setup for multi column (not the sample code), I just dont know how to use it.

    Any hints, tips or examples are welcome.
    Last edited by Rick_Stanich; 01-12-2010 at 03:30 PM.
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multi Column ListBox

    You need to specify the columns,much like use Cells(1,1) in a sheet. Columns start at 0.

    Not sure if you can use different Fonts for each column, I suspect not
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multi Column ListBox

    Something like this
    Please Login or Register  to view this content.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Multi Column ListBox

    The formatting of a list item (font name, size, bold, etc.) applies equaly to all items and all columns equaly.

    Have you considered a one column ListBox with
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Multi Column ListBox

    Quote Originally Posted by royUK View Post
    You need to specify the columns,much like use Cells(1,1) in a sheet. Columns start at 0.

    Not sure if you can use different Fonts for each column, I suspect not
    Took me a spell, but I finally grasped what you meant.
    Thanks, sometimes gentle prodding is all I need.
    Please Login or Register  to view this content.
    I seem to have another problem I did not notice. The listbox doesn't scroll down to the last entry. It is always below the bottom of the listbox, selectable (barely), viewable (hardly know its there).

  6. #6
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Multi Column ListBox

    Quote Originally Posted by mikerickson View Post
    The formatting of a list item (font name, size, bold, etc.) applies equaly to all items and all columns equaly.

    Have you considered a one column ListBox with
    Please Login or Register  to view this content.
    Originally I was using a single column listbox, in this particular case with a special font I went with a multi column listbox hoping to use one font (special font) in the first column and another font in the second column.

    Thanks for the info.

  7. #7
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Multi Column ListBox

    Quote Originally Posted by Rick_Stanich View Post
    I seem to have another problem I did not notice. The listbox doesn't scroll down to the last entry. It is always below the bottom of the listbox, selectable (barely), viewable (hardly know its there).
    Is the listbox on a worksheet?
    Remember what the dormouse said
    Feed your head

  8. #8
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Multi Column ListBox

    On a userform.

  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Multi Column ListBox

    Try changing the IntegralHeight property

  10. #10
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Multi Column ListBox

    I have tried that, it does clear up the height issue but then the lixtbox bleeds over other items on the userform. Normally that isnt an issue but in this case I am trying to keep the foot print of the userform to a minimum, currently it is (userform) 254.25x441.

    I guess I can let it grow a bit more.
    Thanks for looking at this..

    Oddly enough, I set the listbox height to 115 and integral to true, 3 out of 4 selections actually shrink the listbox height but all the options are clearly visible.
    Last edited by Rick_Stanich; 01-12-2010 at 02:09 PM.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Multi Column ListBox

    Hello Rick,

    Just for general information, since the ListBox is on a UserForm it is possible to control the font, color, and size of each line. The downside is that it requires Sub-Classing the UserForm and that requires LOTS of API calls. Been awhile since I did any Sub-Classing but it is posssible.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  12. #12
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Multi Column ListBox

    Right! Whats an API Call? LOL

    Im not going to go that far for a simple text mapping macro.

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Multi Column ListBox

    Hello Rick,

    I didn't think you would want to go that route. Just wanted you know it is possible. Perhaps not practical, but possible.

  14. #14
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Multi Column ListBox

    Practical is in the eye of the beholder.

    Or, is that insanity?

    LOL

    thanks for the info

+ 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