Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kevin
Add this after your AddItem line Me.ListBox1.TopIndex = Me.Listbox1.ListCount - 1 -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help!
-- Kevin "Dick Kusleika" wrote: Kevin Add this after your AddItem line Me.ListBox1.TopIndex = Me.Listbox1.ListCount - 1 -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your help!
-- Kevin "Patrick Molloy" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel 2003 | Excel Discussion (Misc queries) | |||
How to get a listbox to move when scrolling down spreadsheet | Excel Discussion (Misc queries) | |||
Want listbox to move when scrolling down spreadsheet | Excel Discussion (Misc queries) | |||
listbox scrolling with mouse | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming |