View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Josh Sale Josh Sale is offline
external usenet poster
 
Posts: 177
Default ListBox Questions

Sorry, I just figured out the answer to Q1 ... TopIndex ... duh.

Still interested in help on Q2.

josh




"Josh Sale" <jsale@tril dot cod wrote in message
...
I have an unbound ListBox on a VBA form with enough items that vertical
scrolling is required to see all of the items and have a couple of
questions:

Q1: I populate the ListBox in my VBA code and select one of the entries.
Is there a way to ensure that the selected item is scrolled into the
visible portion of the ListBox? For example if the ListBox has 50 items,
can display 20 at a time and my code has selected item 30, is there a way
to force the display of items 20 - 40?


Q2: After I populate the ListBox, I'd like to allow the user to scroll
through the ListBox but not change the selected item. I've played around
with various combinations of the Enabled and Locked properties and it
seems like if I disable or lock the control, then scrolling is disabled
along with selection.

TIA,

josh