Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: List Box - not able to scroll to last item

  1. #1
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default List Box - not able to scroll to last item

    I have a list box that I'm filling dynamically (depends on the file being opened, there could be 1 item and there could be up to 100). When I'm done adding items, etc., I'm not able to scroll to the last item. The microsoft link below does not satisfy what I want to do. I don't want the list box to be as long as the list - I'm fine with the user scrolling to find what they want.

    Here's what I've tried so far:

    • Setting the height to smaller than I want, then back to the height I really want
    • Setting the height to larger than the list, then back to my desired height (when I turn screenupdating on, I can see the last item when the list is made very tall - but it disappears once the height is set smaller again).
    • Adding another item then deleting it


    None of these has worked. I am using fixed numbers to set the height (this refers to the link below).

    Any suggestions?

    -Russell

    http://support.microsoft.com/default...;EN-US;Q211696

    [ This Message was edited by: Russell Hauf on 2002-05-07 15:14 ]

    [ This Message was edited by: Russell Hauf on 2002-05-07 15:14 ]

  2. #2
    MrExcel MVP Jay Petrulis's Avatar
    Join Date
    Mar 2002
    Location
    Chicago, IL USA
    Posts
    2,040
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Just a wild stab...can you add a blank as the last item, or even something like --- and see if that shows up?

    It may not show up and the last item you really want does. If this shows up and the real last item doesn't there are some referencing issues. If all show up, you may need to handle if the user selects the --- item.

    Bye,
    Jay

    EDIT: Disregard this, as I didn't see item 3 in what you've tried already. Sorry.

    [ This Message was edited by: Jay Petrulis on 2002-05-07 16:51 ]

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Millbank, London, UK
    Posts
    1,790
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-07 15:13, Russell Hauf wrote:
    I have a list box that I'm filling dynamically (depends on the file being opened, there could be 1 item and there could be up to 100).Hauf on 2002-05-07 15:14 ]
    What do you mean by "depends on the file being opened"

    and, what's your dynamic formula ?

    everything else looks cast-iron kosher : but these two look potentially suspect...


  4. #4
    MrExcel MVP Russell Hauf's Avatar
    Join Date
    Feb 2002
    Location
    Portland, OR Area - USA
    Posts
    1,609
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    No formula, through code. Everything works but scrolling to the last row. What I've done is to add an extra item in my ListBox (that won't be seen), and coded around it. It works, but I'd still like to know how to fix this obvious bug.

  5. #5
    New Member
    Join Date
    Sep 2003
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    very annoying bug this, i too would be keen to see some code to side step it if anyone has managed to do so.

  6. #6
    New Member
    Join Date
    Mar 2005
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Figured out a fix...

    I know this is an old post, but I was having this same problem and figure out a fix. Simply change the text alignment of the listbox. Voila. You can now scroll to the bottom and see the last item. You can change it back and it seems to remain fixed. Just thought I'd post it as I could not find a fix posted anywhere.

  7. #7
    New Member
    Join Date
    Dec 2005
    Location
    Chicago
    Posts
    45
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Integral Height = True is the fix

    Hi all,

    I'm having the same problem... but figured it out!

    flash281... changing the text alignment doesn't seem to work for me.
    Besides, then I can't have the text aligned to the left.

    What you need to do it change the 'Integral Height' field to true.
    This may and probably will change the size of your listbox, but you'll always be able to see the last item in the box.

    Happy exceling!
    s_c

  8. #8
    New Member
    Join Date
    Mar 2009
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: List Box - not able to scroll to last item

    Just one more pecision. The integralheight property first needs to be set to False, then add items to your listbox and then set integralheight = true.

    This has done it for me !

    Hope this helps.

    DarthVador

  9. #9
    Board Regular
    Join Date
    Aug 2006
    Location
    Arlington, VA
    Posts
    94
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: List Box - not able to scroll to last item

    This was a very useful post. Thanks! I was having the same issues (font size changed when listbox was reloaded) and users couldn't scrool down to last list item if list went beyond box.

    Changing the listbox's IntegralHeight setting to TRUE, filling list using code, and then changing setting to TRUE fixed *both* of these very annoying issues.

  10. #10
    Board Regular
    Join Date
    Aug 2006
    Location
    Arlington, VA
    Posts
    94
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: List Box - not able to scroll to last item

    UPDATE: Well, actually this code did NOT fix the font increasing problem. It returned soon after when doing more testing.

    However, I found that while troubleshooting if I put a break on the code after I fill the listbox, then ran through until the end the listbox font was fine. This led me to put a brief (< 1 second) pause in the code at the end of my WITH statement and for now it seems to be working.

    Maybe this is an issue with the PC's processor?

    Application.Wait (Now + TimeValue("0:00:01") * .5)

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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