Hi everyone,
I am a complete newbie to VBA, and have googled my way to this point, but I can't seem to figure out how to add a message boxes when any information is entered into a certain column.
I have gotten the msgbox to work when I know the set value that will be entered as there is data validation on those cells, however in column BA, it could be any information at all could be entered. What I want is for a msgbox to pop up only when new data is entered, but at the moment, a msgbox appears when there are any changes at all in that range, including deleting the content, which I do not want.
Here is the full code - any suggestions would be really appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("L2:L6000,K2:K6000,BM2:BM6000,AZ2:AZ6000")) Is Nothing Then
Select Case Target
Case "Notice": MsgBox (MsgBox ("text here")
Case "Risk": MsgBox ("text here")
Case "1000": MMsgBox ("text here")
Case "2000": MsgBox ("text here")
Case "A": MsgBox ("text here")
Case "B": MsgBox ("text here")
Case "C": MsgBox ("text here")
Case "D (MsgBox ("text here")
End Select
End If
If Not Intersect(Target, Range("BA2:BA6000")) Is Nothing Then
MsgBox ("text I want to display here"), vbInformation, "Reminder"
End If
End Sub
I am a complete newbie to VBA, and have googled my way to this point, but I can't seem to figure out how to add a message boxes when any information is entered into a certain column.
I have gotten the msgbox to work when I know the set value that will be entered as there is data validation on those cells, however in column BA, it could be any information at all could be entered. What I want is for a msgbox to pop up only when new data is entered, but at the moment, a msgbox appears when there are any changes at all in that range, including deleting the content, which I do not want.
Here is the full code - any suggestions would be really appreciated!
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("L2:L6000,K2:K6000,BM2:BM6000,AZ2:AZ6000")) Is Nothing Then
Select Case Target
Case "Notice": MsgBox (MsgBox ("text here")
Case "Risk": MsgBox ("text here")
Case "1000": MMsgBox ("text here")
Case "2000": MsgBox ("text here")
Case "A": MsgBox ("text here")
Case "B": MsgBox ("text here")
Case "C": MsgBox ("text here")
Case "D (MsgBox ("text here")
End Select
End If
If Not Intersect(Target, Range("BA2:BA6000")) Is Nothing Then
MsgBox ("text I want to display here"), vbInformation, "Reminder"
End If
End Sub