Storing a selected ListBox item into a String variable [modified]
-
I want to be able to click on an item in a ListBox, then using the AfterUpdate() Sub-routine, be able to store that value into a String variable. My loop is as follows: ***START*** Dim iterator As Long Dim descriptionString As String For iterator = 0 to Descriptions_lst.ListCount - 1 If Descriptions_lst.Selected(iterator) Then descriptionName = Descriptions_lst.Column(0, iterator) End if Next iterator ***END*** I'm not exactly sure what the 'Column' does, but apparently this is supposed to get the string value from the selected ListBox item. However, it is not working. I just get empty values for my descriptionName variable. Any ideas? -- modified at 10:04 Thursday 14th June, 2007
-
I want to be able to click on an item in a ListBox, then using the AfterUpdate() Sub-routine, be able to store that value into a String variable. My loop is as follows: ***START*** Dim iterator As Long Dim descriptionString As String For iterator = 0 to Descriptions_lst.ListCount - 1 If Descriptions_lst.Selected(iterator) Then descriptionName = Descriptions_lst.Column(0, iterator) End if Next iterator ***END*** I'm not exactly sure what the 'Column' does, but apparently this is supposed to get the string value from the selected ListBox item. However, it is not working. I just get empty values for my descriptionName variable. Any ideas? -- modified at 10:04 Thursday 14th June, 2007
-
I only find the ListCount and Selected properties in the Office classes. Is this VBA?
--- single minded; short sighted; long gone;