antaeusguy
Board Regular
- Joined
- Mar 8, 2010
- Messages
- 81
I've inserted a Listbox into a Userform which property "Row Source" is linked to a range of cells. To make things simple, the ListBox has 3 values: Apple, Kiwi & Banana, obtaining from cell A1, A2 & A3.
What I want to achieve is that when I click on a fruit (say Apple) to select it, and when I hit Enter, the value Apple will be transferred to a cell (say in Cell C1).
I tried to use the Enter event for the list box:
Private Sub ListBox1_Enter()
Range("C1").Value = ListBox1.Value
Unload Me
End Sub
Unfortunately it gives an error message like below:
run-time error '-2147417848 (800101108)':
Automation error
The object invoked has disconnected from its clients.
Does anyone knows what did I did wrong in my code? Appreciate your help very much!
What I want to achieve is that when I click on a fruit (say Apple) to select it, and when I hit Enter, the value Apple will be transferred to a cell (say in Cell C1).
I tried to use the Enter event for the list box:
Private Sub ListBox1_Enter()
Range("C1").Value = ListBox1.Value
Unload Me
End Sub
Unfortunately it gives an error message like below:
run-time error '-2147417848 (800101108)':
Automation error
The object invoked has disconnected from its clients.
Does anyone knows what did I did wrong in my code? Appreciate your help very much!