Scroll vertical scrollbar to the bottom of list

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
Hi
Can I get a script to scroll the vertical scrollbar to the bottom of the list of a listbox?

I load the listbox each time I add data . So I will like to see the last item.

Thanks
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
I have the listbox on a userform will this do ?

It seems to me this code assumes the listbox is on a worksheet.

Regards
Kelly
 
Upvote 0
You would need something like this in your script:
Code:
ListBox1.ListIndex = ListBox1.ListCount - 1
 
Upvote 0
Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.


I just
I just fell into a trap:

I am sorting the data before loading the listbox so the last data might not be the current one.

Is there a way to get the current entered data selected?

Regards
Kelly
 
Upvote 0
Not sure what:
the current entered data selected is



Ime
I mean the last data entered. That should be at the last row but after the sort, it's place might change. So I am thinking if there is a way to find and select it
 
Upvote 0
This is beyond my knowledgebase.
I will continue to monitor this thread to see what I can learn.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top