Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default another listbox question

hi all, following on from another question, is it possible to display
data that is filtered within a list box, i only want certain data to
appear in this list the list is automatically filtered, but the whole
list still appears in the list box.

regards john

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default another listbox question

Private Sub UserForm_Activate()
Dim rng As Range, rng1 As Range
Dim cell As Range
Dim i As Long
ListBox1.Clear
ListBox1.ColumnCount = 4
Set rng = Range("a2:a50")
On Error Resume Next
Set rng1 = rng.SpecialCells(xlVisible)
On Error GoTo 0
If Not rng1 Is Nothing Then
For Each cell In rng1
ListBox1.AddItem cell.Value
i = ListBox1.ListCount - 1
ListBox1.List(i, 1) = cell.Offset(0, 1)
ListBox1.List(i, 2) = cell.Offset(0, 2)
ListBox1.List(i, 3) = cell.Offset(0, 3)
Next
End If

End Sub

--
Regards,
Tom Ogilvy




wrote in message
oups.com...
hi all, following on from another question, is it possible to display
data that is filtered within a list box, i only want certain data to
appear in this list the list is automatically filtered, but the whole
list still appears in the list box.

regards john



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox Question Greg B Excel Discussion (Misc queries) 1 March 9th 05 02:17 PM
Listbox Question Greg B Excel Worksheet Functions 1 March 9th 05 02:17 PM
Listbox Question Greg B Excel Worksheet Functions 0 March 9th 05 12:46 AM
ListBox Question Tom Ogilvy Excel Programming 1 August 24th 04 05:43 PM
ListBox Question RK[_2_] Excel Programming 9 May 23rd 04 10:36 PM


All times are GMT +1. The time now is 10:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"