I have a userForm with a ListBox taking its values from a named range. I use the following code to record the chosen value in a cell.
Private Sub ListBox1_Click()
If ListBox1.ListIndex <> -1 Then
Sheets("Sheet1").Range("C3").Value = ListBox1.Value
End If
End Sub
My problem is that when the UserForm is hidden either manually or by code, the value in C3 is cleared.
I would like to know why this happens and how to stop it.
I have made a simplified version of this to help with the understanding of the problem. Unfortunately in this case the value in C3 remains until the value of the listbox is changed, which is what I want to happen
John
Bookmarks