View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default ListBox Execution


Try recording a macro while you filter the sheet.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Carrie_Loos via OfficeKB.com"
wrote in message
Hi - I have created a userform(multi) with a ListBox (Multiple Lists) on a
tab and I am now stuck. What I need to do is when the user selects a choice
in one of the listboxes I want it to go to a sheet named "Classes" and select
the appropriate column and value, from the listbox, and apply it to the
filters I have so that only that item appears on the sheet. I have gotten as
far as below with the 'MsgBox "True" and MsgBox "False' as place holders but
I cannot figure out how to write the filter portion....[In this case the
Unique_Class_ID is in column E] Can anyone help?
Thanks
Carrie


Dim ctrl As Control
ListBox1.RowSource = "CLasses!Unique_Class_ID"
Select Case ListBox1.ListIndex
Case -1
MsgBox "True"
Case Else
MsgBox "False"
End Select

For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSForms.TextBox Then
ctrl.Value = ""
ElseIf TypeOf ctrl Is MSForms.OptionButton Then
ctrl.Value = False
End If
Next ctrl