Disable SetFocus on ListBox

wist

Board Regular
Joined
Nov 8, 2012
Messages
79
Hi,

I have a long ListBox and I have to scroll the UserForm to get to the bottom of the ListBox.

Problem is that when I scroll down the focus is moved to scrollbar and when I click the bottom value on the ListBox the focus moves onto the ListBox and scrolls all the way up again.

I would very much like to disable this annoying function.

Any ideas please?

Thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
18,705
Office Version
  1. 2013
Platform
  1. Windows
UserForm Listbox automatically have a ScrollBar.

Why do you need to:
You said:
I have to scroll the UserForm

You can just use the ScrollBar on the ListBox

And with a listbox you can just enter G for example to jump down to the first value that starts with a G

Are you aware of this?
 

wist

Board Regular
Joined
Nov 8, 2012
Messages
79
thanks for the suggestion however there are frames that are tied to the listbox so if I enable scrolling in listbox they would not be aligned anymore
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
18,705
Office Version
  1. 2013
Platform
  1. Windows
Not sure what you mean about frames tied to listbox.

But I have no other ideal.

So your saying if you have 100 items in a listbox then you must make your listbox very long.
That's a bad situation.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,016
Messages
5,834,943
Members
430,327
Latest member
Mr_Himalayan778

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
Top