Option Explicit
Public MyLocation As Range
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 21 Then Exit Sub
If Target.Value > 0 Then
If Target.Offset(0, -10).Value = "" Then
Application.EnableEvents = False
Set MyLocation = Target.Offset(0, -10)
frmLocation.Show
End If
End If
Application.EnableEvents = True
End Sub
Option Explicit
Private Sub cmdOk_Click()
If ListBox1.ListIndex <> -1 Then
MyLocation.Value = ListBox1.Value
Unload Me
Else
MsgBox "Please select a location"
End If
End Sub
Private Sub UserForm_Initialize()
' your code to populate listboxox
End Sub