Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ListBox, linked to a range - select cells
i have a multicolumn list box, "ListBox1", with this statement on it's click
event. Private Sub ListBox1_Click() If ListBox1.ListIndex < -1 Then Rows(ListBox1.ListIndex + 2).Select End If End Sub i have made this list box a MultiSelect listbox. how can i modify this code to make it select the multiple rows as if the user was holding Ctrl and selecting rows? TIA. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
MultiColumn ListBox, linked to a range - select cells
I changed the procedure to _change.
Option Explicit Private Sub ListBox1_Change() Dim iCtr As Long Dim Rng As Range For iCtr = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(iCtr) = True Then If Rng Is Nothing Then Set Rng = Cells(iCtr + 2, "A") Else Set Rng = Union(Cells(iCtr + 2, "A"), Rng) End If End If Next iCtr If Rng Is Nothing Then 'do nothing Else Rng.EntireRow.Select End If End Sub Spencer Hutton wrote: i have a multicolumn list box, "ListBox1", with this statement on it's click event. Private Sub ListBox1_Click() If ListBox1.ListIndex < -1 Then Rows(ListBox1.ListIndex + 2).Select End If End Sub i have made this list box a MultiSelect listbox. how can i modify this code to make it select the multiple rows as if the user was holding Ctrl and selecting rows? TIA. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multicolumn Listbox with variable range | Excel Programming | |||
multicolumn listbox move or value set | Excel Programming | |||
Reordering with Multicolumn Listbox | Excel Programming | |||
Multicolumn Listbox and ordinary listbox | Excel Programming | |||
multicolumn Listbox and textalignment | Excel Programming |