Hi all,
Complete newbie here, but coming across an issue with my VBA code and I'm not sure how to fix!
The only VBA code on this spreadsheet is below, which I am using for popping up message boxes when certain cell values are changed or selected from the data validation drop down.
It works fine when one cell is changed at a time, or if I ctrl + click to select multiple cells and then paste into the cells, but if I click and drag to highlight multiple cells in any of the columns in range, and interact with the cells (either pasting a value or deleting data), I get a run-time error code '13' - type mismatch. What I want is for the pop up box to appear once for the selection.
Any help would be greatly appreciated!
Complete newbie here, but coming across an issue with my VBA code and I'm not sure how to fix!
The only VBA code on this spreadsheet is below, which I am using for popping up message boxes when certain cell values are changed or selected from the data validation drop down.
It works fine when one cell is changed at a time, or if I ctrl + click to select multiple cells and then paste into the cells, but if I click and drag to highlight multiple cells in any of the columns in range, and interact with the cells (either pasting a value or deleting data), I get a run-time error code '13' - type mismatch. What I want is for the pop up box to appear once for the selection.
Any help would be greatly appreciated!
Code:
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 "Redeployed": MsgBox ("1. text here" & vbNewLine & "2. text here" & vbNewLine & "3. text here" & vbNewLine & "4. text here" & vbNewLine & "5. text here" & vbNewLine & "6. text here" & vbNewLine & "7. text here"), vbInformation, "Checklist for Redeployment"
Case "Formal Notice": MsgBox ("text here), vbInformation "Reminder"
Case "At Risk": MsgBox ("1. text here" & vbNewLine & "2. text here"), vbInformation, "Reminder"
Case "1000": MsgBox ("text here), vbInformation, "Reminder"
Case "2000": MsgBox ("text here), vbInformation, "Reminder"
Case "A": MsgBox ("text here), vbInformation, "Reminder"
Case "B": MsgBox ("text here), vbInformation, "Reminder"
Case "C": MsgBox ("text here), vbInformation, "Reminder"
Case "D (full&full)": MsgBox ("text here), vbInformation, "Reminder"
End Select
End If
If Target.Value = "" Then Exit Sub
If Not Intersect(Target, Range("BA2:BA6000")) Is Nothing Then
MsgBox ("1. text here" & vbNewLine & "2. text here" & vbNewLine & "3. text here" & vbNewLine & "4. text here"), vbInformation, "Reminder"
End If
End Sub