Consulting

Results 1 to 5 of 5

Thread: Userforms, Listboxes, Virtual space.

  1. #1

    Userforms, Listboxes, Virtual space.

    Hi All,

    difficult question time.

    I want to make a listbox and have the column headings display A, B, C, D, E, etc. The true column headers.

    I've figured the way to do this is to copy the data and insert A, B, C, D, E etc, above it. However, I do -not- want to make a new worksheet and physically copy it. This feels clumsy and archaic.

    How can I go about making a range source in virtual space so that I can avoid storing my data on a worksheet just to get some proper column headings on it? Never mind the fact that setting column headings should not force you to base it on "the row above your range source".

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    I would not use Userform1.Listbox1.ColumnHeads=True. I would just set the first row as a pseudo header. e.g. http://vbaexpress.com/forum/showthread.php?p=169149

  3. #3
    Quote Originally Posted by Kenneth Hobs
    I would not use Userform1.Listbox1.ColumnHeads=True. I would just set the first row as a pseudo header. e.g. http://vbaexpress.com/forum/showthread.php?p=169149
    I think thats what I'm going to wind up doing, is to use .additem rather than .rowsource.

    However, I would very much like to retain the grid lines on the first row... the data is not scrollable as it only ever shows 5-10 lines and the listbox is tall enough to not scroll down, but I'd really like something to distinguish my top row as headers. Any hints?

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    You are limited by the control. Try the ListView control.

    http://dailydoseofexcel.com/archives...2/26/listview/

  5. #5
    Ouch...i got my hopes up for that one, after seeing what it looked like, its PERFECTION!!! However, i cannot go around and install the required .ocx files on everyones computer

    =(

    oh well. Guess i'm stuck with a super ugly listbox.

Posting Permissions

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