+ Reply to Thread
Results 1 to 6 of 6

How to use ColumnHeads in a ListBox?

  1. #1
    Registered User
    Join Date
    07-17-2007
    Location
    Buenos Aires
    Posts
    12

    How to use ColumnHeads in a ListBox?

    Hi,
    Can anyone post an example (or send a link for an already existing one) on how to program a ListBox so the first line is used as the column's header? According to VBA documentation, if the ListBox.ColumnHeads flag is set to TRUE, then the first line of the Column matrix is used as the column's headers, but there is no example on how the column's matrix should be build in these cases. If anyone has an example, I would like to have a copy of it. Many thanks.

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

    Re: How to use ColumnHeads in a ListBox?

    It only works if you use the Rowsource property to bind the listbox to a range. Then the row above the Rowsource is used for the column headers.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-17-2007
    Location
    Buenos Aires
    Posts
    12

    Re: How to use ColumnHeads in a ListBox?

    Quote Originally Posted by romperstomper View Post
    It only works if you use the Rowsource property to bind the listbox to a range. Then the row above the Rowsource is used for the column headers.
    It worked, perfectly.
    Now just one more doubt (for anyone): Is there any way to make some of the columns at the left to be fixed? It means, without horizontal scrolling if the ListBox is wider than the displayed window.
    Many thanks

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

    Re: How to use ColumnHeads in a ListBox?

    No, unfortunately - if you have a scrollbar it scrolls everything.

  5. #5
    Registered User
    Join Date
    07-17-2007
    Location
    Buenos Aires
    Posts
    12

    Thumbs up Re: How to use ColumnHeads in a ListBox?

    Quote Originally Posted by romperstomper View Post
    No, unfortunately - if you have a scrollbar it scrolls everything.
    OK, thanks

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

    Re: How to use ColumnHeads in a ListBox?

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Hope that helps.

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

    Free DataBaseForm example

+ 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