coach_veto
New Member
- Joined
- Jan 26, 2016
- Messages
- 15
Hi,
So I recently made a userform listbox that references a list of countries I have. I have the following code pasted in Sheet1 so that when I click one of the cells referenced, the userform pops up.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)If Not Application.Intersect(Target, Range("A1:A10")) Is Nothing Then
UserForm1.Show
End If
End Sub
My problem is that once the list pops up, I want to be able to select one of the country names from this list and have it populate that country name in the active cell. I want to do this without having to create and click a command button. I also would like the list to disappear once a selection has been made and the cell is populated.
What code would I need? Does it go in the sheet1 area or the userform code area?
Thanks guys!
So I recently made a userform listbox that references a list of countries I have. I have the following code pasted in Sheet1 so that when I click one of the cells referenced, the userform pops up.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)If Not Application.Intersect(Target, Range("A1:A10")) Is Nothing Then
UserForm1.Show
End If
End Sub
My problem is that once the list pops up, I want to be able to select one of the country names from this list and have it populate that country name in the active cell. I want to do this without having to create and click a command button. I also would like the list to disappear once a selection has been made and the cell is populated.
What code would I need? Does it go in the sheet1 area or the userform code area?
Thanks guys!