Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Mar 2005
    Location
    Wellington, Wellington
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    UnBound Listbox Headings (Excel97)

    I know there is a simple answer to this, but my poor beleagured brain can't cope right now. <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    I am trying to work with a multi-column listbox that uses unbound data. I want to ensure that each column has a certain heading.

    ColumnHeads is set to True, and the RowSource is blank, but I can't find any way of setting what the column headers are. Given the MS Help functions, it would seem that the first row of the array would be used for the headings.

    The whole thing is just to be used to simply populate a listbox from three textboxes, and, when complete, the data in the listbox is used for a rather complex interest calculation.

    Any advice is appreciated. <img src=/S/grovel.gif border=0 alt=grovel width=31 height=23>


    Gravey

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: UnBound Listbox Headings (Excel97)

    Gravey

    according to the help in MS-Excel 97 it is the first row of the data that becomes the header for the ListBox.

    <<< Remarks When the system uses the first row of data items as column headings, they can't be selected. >>>

    Since your RowSource is blank, then where would the list get its items?

    Once you fill the RowSource you will be amazed how wrong the Help file is. Actually if your range of data is in A1 to C16, the RowSource will be A2:C16...

    Don't ask... <img src=/S/surrender.gif border=0 alt=surrender width=31 height=23> but MS does these things without telling us. You don't include the Header of the range in your RowSource...

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    New Lounger
    Join Date
    Mar 2005
    Location
    Wellington, Wellington
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: UnBound Listbox Headings (Excel97)

    Thanks for that, Wassim. <img src=/S/bow.gif border=0 alt=bow width=15 height=15>

    I had found out how to do it where the data source is bound to a range object, but I was trying to work it out where the data source is an unbound array. I stumbled across that wee anomaly in the help - the header is taken from the row immediately above the rowsource range. <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    Essentially, what I am trying to do in the end is create a userform that allows users to populate a three-column listbox, with adding and removing items, and when ready to commit the result, have it populate a range in the sheet.

    Maybe I have been making presumptions about the best way to do this. Any suggestions?

  4. #4
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: UnBound Listbox Headings (Excel97)

    Gravey

    Ok so you said that you are populating the ListBox from User Input. I guess since you will end up using a range, have that range be the RowSource.

    Each time the User enters something, it gets added into that range, and then when the user commit the range is cleared / manipulated as desired.

    You could va code advance the RowSource range so that it contains the new items as the user adds them, display them into the ListBox and then have the User manipulate this process until they are happy.

    If you need an example I'll wip something for you...

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

Posting Permissions

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