Thread: ListBox Result
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Colo[_53_] Colo[_53_] is offline
external usenet poster
 
Posts: 1
Default ListBox Result

Hi Randy,

You can know the selected value with this code.

Code:
--------------------

ListBox1.list(ListBox1.listindex)

--------------------


If MultiSelect has been used, need to loop like this.


Code:
--------------------

For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
MsgBox "Item " & i + 1 & " has been Selected"
End If
Next

--------------------


Regarding to how to copy Autofiltered(excluding headers) range would be
as follows.


Code:
--------------------

With Sheets(1).AutoFilter.Range
.Resize(.Rows.Count - 1).Offset(1).Copy Sheets(2).Cells(1, 1)
End With

--------------------



---
Message posted from http://www.ExcelForum.com/