Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListIndex
I have a combobox called ComboBox3. One of the values in
the combobox is "Export from Un-Opened Workbook..." Now I dont know what position it is in the combobox but I know I want it moved to the very end. The below code tells me how many items are in the combobox. If variable IndxNumber = 4, then I want for the value "Export from Un- Opened Workbook..." to be moved to listindex postion number 4 (very last position) Dim IndxNumber IndxNumber = ComboBox3.ListIndex + 1 How do I do this? Thank you Todd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListIndex
Hi Tood,
One way Dim sValue Dim i As Long Dim j As Long With ComboBox1 For i = 0 To .ListCount - 1 If .List(i) = Export from Un-Opened Workbook..." Then sValue = .List(i) For j = i To .ListCount - 2 .List(j) = .List(j + 1) Next j .List(.ListCount - 1) = sValue Exit For End If Next i End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Todd Huttenstine" wrote in message ... I have a combobox called ComboBox3. One of the values in the combobox is "Export from Un-Opened Workbook..." Now I dont know what position it is in the combobox but I know I want it moved to the very end. The below code tells me how many items are in the combobox. If variable IndxNumber = 4, then I want for the value "Export from Un- Opened Workbook..." to be moved to listindex postion number 4 (very last position) Dim IndxNumber IndxNumber = ComboBox3.ListIndex + 1 How do I do this? Thank you Todd |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListIndex
Thanks
-----Original Message----- Hi Tood, One way Dim sValue Dim i As Long Dim j As Long With ComboBox1 For i = 0 To .ListCount - 1 If .List(i) = Export from Un-Opened Workbook..." Then sValue = .List(i) For j = i To .ListCount - 2 .List(j) = .List(j + 1) Next j .List(.ListCount - 1) = sValue Exit For End If Next i End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Todd Huttenstine" wrote in message ... I have a combobox called ComboBox3. One of the values in the combobox is "Export from Un-Opened Workbook..." Now I dont know what position it is in the combobox but I know I want it moved to the very end. The below code tells me how many items are in the combobox. If variable IndxNumber = 4, then I want for the value "Export from Un- Opened Workbook..." to be moved to listindex postion number 4 (very last position) Dim IndxNumber IndxNumber = ComboBox3.ListIndex + 1 How do I do this? Thank you Todd . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform problem (Listindex) | Excel Discussion (Misc queries) | |||
Use ListIndex to set Sheet order? | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
ListIndex = cell value? | Excel Programming |