Option Explicit
Private oldAddress As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
' Prevent drag fill by breaking the selection extension
If oldAddress = Selection.Address Then
Exit Sub
End If
oldAddress = Selection.Address
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo exitsafe
If Application.EnableEvents = False Then Exit Sub
Application.EnableEvents = False
' --- Detect autofill drag (Excel always delivers big block change)
If Target.Cells.CountLarge > 1 And Application.CutCopyMode = False Then
Application.Undo
MsgBox "Drag Fill is disabled on this sheet.", vbExclamation
GoTo exitsafe
End If