ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   List Box Selections (https://www.excelbanter.com/excel-worksheet-functions/52268-list-box-selections.html)

Jez

List Box Selections
 
Please help,

I have a List box from which I want to be able to select multiple options
and from this hide the rows other than the selected rows.

What vba code can I use to do this.

Thanks,
Jez

Bob Phillips

List Box Selections
 
With Me.ListBox1
For i = 0 To .ListCount - 1
If .Selected(i) Then
Range(myData).Offset(i,0).Entirerow.Hidden = True
End If
Next i
End With

This assumes that the listbox is sourced from a range named myData.


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jez" wrote in message
...
Please help,

I have a List box from which I want to be able to select multiple options
and from this hide the rows other than the selected rows.

What vba code can I use to do this.

Thanks,
Jez





All times are GMT +1. The time now is 02:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com