Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2003
I have a 2 column, populated ListBox. The ListBox selection routine includes the code:- MyIndex = UserForm1.ListBox1.ListIndex (under <<Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, _ ByVal X As Single, ByVal Y As Single)) and MyIndex is a Publically declared variable. The purpose of recording the user's selection in the MyIndex variable is so that it can be used in the UserForm Initialize process to highlight the last selection. The Initialize routine therefore includes the code:- UserForm1.ListBox1.ListIndex = MyIndex (under <<Private Sub UserForm_Initialize()) When the UserForm/ListBox code is run, I get an error Runtime Error 380 and <<Could not set the ListIndex Property. Invalid Property Value. I have used this code in another project and it runs fine. The only difference is the ListBox in the project that works has 1 column, whereas the one that fails has 2. Any ideas would be welcome donwb |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dependent List "Index" Problem | Excel Worksheet Functions | |||
Problem using INDEX to select items in listbox | Excel Discussion (Misc queries) | |||
list index problem | Excel Programming | |||
Listbox Index Problem | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming |