Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListBox Execution
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 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200802/1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListBox Execution
Yes, thanks, I did try that without success. And after all I have been
reading in help and other books that I have, I am beginning to wonder if you can't select a value out of a list box? Jim Cone wrote: Try recording a macro while you filter the sheet. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200802/1 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
ListBox Execution
Dim strSomething as String strSomething = Me.ListBox1.Value Worksheets("Stuff").Range("B5").Value = strSomething '-- With a multi-select listbox you have to run a loop. -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "Carrie_Loos via OfficeKB.com" wrote in message Yes, thanks, I did try that without success. And after all I have been reading in help and other books that I have, I am beginning to wonder if you can't select a value out of a list box? Jim Cone wrote: Try recording a macro while you filter the sheet. -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...mming/200802/1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
userform listbox cannot get listbox.value to transfer back to main sub | Excel Programming | |||
avoiding duplicates in listbox (added from another listbox) | Excel Programming | |||
VBA: Creating listbox similar to the one in Pivot table (Listbox+Checkbox) | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming |