Is it possible to fill a listbox on workbook open?
![]()
Please Login or Register to view this content.
Is it possible to fill a listbox on workbook open?
![]()
Please Login or Register to view this content.
Last edited by Cutter; 08-27-2012 at 02:40 PM. Reason: Replaced quote tags with code tags
zplugger,
You almost had it:
![]()
Please Login or Register to view this content.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Thanks again tigeravatar that help me with the problem I have. If I add to the code I get a error? hoping to have it open to first item in list.
PHP Code:
Private Sub Workbook_Open()
Sheet1.ListBox1.List = Sheet1.Range("test").Value
ListBox1.Selected(0) = True
End Sub
Explaining a bit:![]()
Please Login or Register to view this content.
The Workbook_Open event doesn't know what sheet you're on. So you have to explicitly tell it the sheet and object you're working with. That is why it needed Sheet1.Listbox1. Instead of writing that out 2 times for each line of code, you can just use the With statement until you're done with that object.
Last edited by tigeravatar; 08-27-2012 at 12:42 PM. Reason: added explanation
Thank You Works Perfect, another great job from this great forum
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks