Diving_Dan
Board Regular
- Joined
- Oct 20, 2019
- Messages
- 161
Hi all,
I need a userform to be shown if a cell value changes.
At present on a worksheet I have certain cells with data validation in place with "guest" as one of the options to choose. What I would like to happen is if I choose "guest" from the drop down list for my userform to show on it's own. At the moment with the code I have the userform doesn't show when I choose "guest". If I select a different cell and then click back in the cell showing "guest" the userform will launch but I would like it to launch as soon as I choose "guest" on the list.
This is the code I have at the moment
I need a userform to be shown if a cell value changes.
At present on a worksheet I have certain cells with data validation in place with "guest" as one of the options to choose. What I would like to happen is if I choose "guest" from the drop down list for my userform to show on it's own. At the moment with the code I have the userform doesn't show when I choose "guest". If I select a different cell and then click back in the cell showing "guest" the userform will launch but I would like it to launch as soon as I choose "guest" on the list.
This is the code I have at the moment
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Value = "Guest" Then
frmAddStaff.Show
End If
End Sub