ListBox Scrolling in VBA
dim index as long
after you add your items set the index to the listcount property then set
the list's listindex to this...
mylist.add something
index = mylist.listcount-1 '' zero based !
mylist.listindex = index
--
Patrick Molloy
Microsoft Excel MVP
---------------------------------
I Feel Great!
---------------------------------
"Kevin" wrote in message
...
Greetings!
In Excel 2000 I am using a ListBox on a UserForm to display the progress
of a lengthy procedure to the end user. As tasks are completed, I call the
ListBox.AddItem method to add items to the end of the list. The problem is
that the list soon becomes longer than what the ListBox viewable area can
accommodate. When this happens, Windows dutifully provides a scrollbar for
the user to scroll down to see subsequently added lines.
My question is: How can I make it scroll programatically so that the last
item in the list is always visible? I have searched and searched but
cannot seem to find the answer. Common sense (a dangerous thing) tells me
that the solution can't be as allusive as it seems.
If anyone knows how to do this, please let me know.
Thanks In Advance!
--
Kevin
|