Get list box top entry / scroll the list box with VBA

yamus

Member
Local time
Today, 20:02
Joined
Aug 12, 2020
Messages
81
Hello
1# I was looking for a method to get the top entry of list box programmatically with vba.
2# Is there a way to scroll the list box with VBA?
Thanks in advance

EDIT:
I did not explain well my first request.
I want to be able to select which item to be displayed as the list box to entry.
 
Last edited:
This should return the first item:

forms!FormName.ListboxName.itemdata(0)

You can certainly loop the listbox. What are you trying to achieve?
 
This should return the first item:

forms!FormName.ListboxName.itemdata(0)

You can certainly loop the listbox. What are you trying to achieve?
i want to choose the top entry position or to scoll the list box programmatically with VBA not with the mouse
 
Well, the code given will let you choose the first item:

Me.List20 = Me.List20.ItemData(0)

I'm not sure how to scroll the listbox other than by clicking on the scroll bar, perhaps someone else does.
 

Users who are viewing this thread

Back
Top Bottom