Hey Tjaart...raas jou koppie vanaand...lol
No diffs...you just added a lrow...
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long
lr = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
If Not Intersect(Target, Range("A7:A" & lr)) Is Nothing Then
If Left(Target.Value, 2) <> "DP" Then
Application.EnableEvents = False
MsgBox "PM NUMBER MUST START WITH DP", vbInformation, ""
Target = ""
Target.Activate
Application.EnableEvents = True
End If
End If
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A7:A5000")) Is Nothing Then
If Left(Target.Value, 2) <> "DP" Then
Application.EnableEvents = False
MsgBox "PM NUMBER MUST START WITH DP", vbInformation, ""
Target = ""
Target.Activate
Application.EnableEvents = True
End If
End If
End Sub
Edit...
As per post 5...this solves the insert and delete rows and the specific text insert...
If Target.Columns.Count = Columns.Count Then Exit Sub
Bookmarks