Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually Update Listindex
I have a combobox on a user form that is populated when the form opens. The
listindex is not updated unless I "reselect" the same value from the dropdown menu. How can I have the listindex automatically update when the combobox is populated. This is on a pretty new version of Excel for Mac. I don't have this problem with the older version of Excel for Mac. Thanks for any help DB |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually Update Listindex
Hello DB, What OS are you running? I tested setting the Listindex of ComboBox using Excel with OS X . I placed the code in the User Form Initialize Event module with no problems. I used ComboBox1.ListIndex = 3 to bring up the 4th item in my list of 5 with no problems. Maybe you should post your code. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=378251 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually Update Listindex
Can't you just set the listindex at the end of your population code.
Something like Private Sub UserForm_Initialize() Dim lCounter As Long With cbInput Application.EnableEvents = False For lCounter = 1 To 10 .AddItem lCounter Next lCounter Application.EnableEvents = True .ListIndex = 0 End With End Sub Robin Hammond www.enhanceddatasystems.com "DB" wrote in message ... I have a combobox on a user form that is populated when the form opens. The listindex is not updated unless I "reselect" the same value from the dropdown menu. How can I have the listindex automatically update when the combobox is populated. This is on a pretty new version of Excel for Mac. I don't have this problem with the older version of Excel for Mac. Thanks for any help DB |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually Update Listindex
"Leith Ross" wrote: Hello DB, What OS are you running? I tested setting the Listindex of ComboBox using Excel with OS X . I placed the code in the User Form Initialize Event module with no problems. I used ComboBox1.ListIndex = 3 to bring up the 4th item in my list of 5 with no problems. Maybe you should post your code. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=378251 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Manually Update Listindex
Basically, the combobox2 list depends on the value of combobox1. If I select
a value from the combobox1 list, combobox2 works just fine. However, if the value of combobox1 is set by code (see below) to a value that is the same as one in the list for combobox1, the list index does not change accordingly. I just had a thought: do you think I need to change the order of the two lines of code in the Initialize sub? Private Sub UserForm_Initialize() ComboBox1.Value = Sheets("Sheet1").Cells(4, 3).Value ComboBox1.List = Sheets("Sheet2").Range("B5:B10").Value End Sub Private Sub ComboBox2_Enter() Dim ListRow As Long ListRow = ComboBox1.ListIndex + 5 ComboBox2.AddItem (Sheets("Sheet2").Cells(ListRow, 3).Value) End Sub "Leith Ross" wrote: Hello DB, What OS are you running? I tested setting the Listindex of ComboBox using Excel with OS X . I placed the code in the User Form Initialize Event module with no problems. I used ComboBox1.ListIndex = 3 to bring up the 4th item in my list of 5 with no problems. Maybe you should post your code. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=378251 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to update one manually-entered value from another? | Excel Worksheet Functions | |||
Manually update links | Excel Worksheet Functions | |||
combo box and .listindex | Excel Programming | |||
listindex | Excel Programming | |||
ListIndex | Excel Programming |