Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
I need to set focus on the first item in a listbox. The listbox is on a userform, the userform has multipages and each page has a listbox. I was using the following
or
or
I need it to setfocus/select and highlight the first item if it has items, if the listbox is blank then do nothing. I can't get it to work
thanks
VBA Code:
ListBox1.SetFocus
VBA Code:
Userform1.ListBox1.SetFocus
VBA Code:
Userform1.Multipage3.Pages (6).ListBox1.SetFocus
thanks