Results 1 to 4 of 4
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    ColumnHeads Property (VBA/Excel/2002)

    If Help did not make the ColumnHeads property mysterious enough, I would be flabbergastted. <img src=/S/cranky.gif border=0 alt=cranky width=18 height=25>

    I have a ListBox that we want to be able to scroll the headings with the contents. I see that there is a ColumnHeads property that can be set to true but cannot find an example that tells me how to fill it.

    Out data does not have a RowSource as it is filled by a SQL query. I do not want to use the column names from the database as they would be meaningless to the users.
    Alan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ColumnHeads Property (VBA/Excel/2002)

    Column headers only work with a list box that has a worksheet range as row source, not with a list box that is filled using code. As an alternative, you can put labels above the list box.

  3. #3
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: ColumnHeads Property (VBA/Excel/2002)

    OK, is there a way to make the labels scroll along with the list? Guess you cannot put the labels on a scroll bar by itself?
    Alan

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ColumnHeads Property (VBA/Excel/2002)

    You could create a list box with one row containing only the column headers, but I don't see any way to synchronize the horizontal scrolling of the two list boxes. There is no On Scroll event or something like that.

Posting Permissions

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