Mar 17 2020 03:14 AM
Hello everyone
I have basic information in let's say columns M, N and O.
In column P I have a dropdown menu consisting of 3 different names.
What I would like now ist
1) that if any data in columns M, N or O get changed, it has to be mandatory to select a different name in column P than the existing one.
2) Or that if any data in columns M, N or O get changed, a Msg box appears to remind the user that one has to select a different option in column P than the existing one, even if there is nothing yet in that cell.
Thank you very much in advance.
Mar 17 2020 03:23 AM
SolutionYou can do this with a very small macro on the page itself:
Private Sub worksheet_Change(ByVal target As Range)
If Not Intersect(target, Range("M:O")) Is Nothing Then
MsgBox ("You must now change the dropdown in column P")
Else
End If
End Sub
I have attached an example - press Alt F11 to open the VBA editor and see the code in situ.
Mar 17 2020 03:51 AM
Top notch! Works like a charm.
Thank you very much for your help.@Savia
Jan 13 2021 06:19 AM
@Savia I'm new to VBA, how can i just make the dropdown mandatory? this is a table where data entry is ongoing
Mar 17 2020 03:23 AM
SolutionYou can do this with a very small macro on the page itself:
Private Sub worksheet_Change(ByVal target As Range)
If Not Intersect(target, Range("M:O")) Is Nothing Then
MsgBox ("You must now change the dropdown in column P")
Else
End If
End Sub
I have attached an example - press Alt F11 to open the VBA editor and see the code in situ.