SOLVED

Excel mandatory cell with dropdown menu

Copper Contributor

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.
 

3 Replies
best response confirmed by Uguey (Copper Contributor)
Solution

You 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.

Top notch! Works like a charm.
Thank you very much for your help.@Savia 

@Savia I'm new to VBA, how can i just make the dropdown mandatory? this is a table where data entry is ongoing

1 best response

Accepted Solutions
best response confirmed by Uguey (Copper Contributor)
Solution

You 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.

View solution in original post