Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to avoid having to enter the following code 72 times (once
for each fo the 72 listboxes I have) in the worksheet: Sheet1.ListBox1.AddItem "Select From List" Sheet1.ListBox1.AddItem "1 (High Risk)" Sheet1.ListBox1.AddItem "2" Sheet1.ListBox1.AddItem "3" Sheet1.ListBox1.AddItem "4" Sheet1.ListBox1.AddItem "5 (Low Risk)" If Sheet1.Range("B5") = "Select From List" Then Sheet1.ListBox1.ListIndex = 0 End If If Sheet1.Range("B5") = "1 (High Risk)" Then Sheet1.ListBox1.ListIndex = 1 End If If Sheet1.Range("B5") = "2" Then Sheet1.ListBox1.ListIndex = 2 End If If Sheet1.Range("B5") = "3" Then Sheet1.ListBox1.ListIndex = 3 End If If Sheet1.Range("B5") = "4" Then Sheet1.ListBox1.ListIndex = 4 End If If Sheet1.Range("B5") = "5 (Low Risk)" Then Sheet1.ListBox1.ListIndex = 5 End If Any help? Thanks, Jeff |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
creating a loop | Excel Discussion (Misc queries) | |||
Creating a loop | Excel Discussion (Misc queries) | |||
Creating a loop | Excel Programming | |||
Creating a loop | Excel Programming | |||
Creating a For Loop | Excel Programming |