Option Explicit
Private Const DV_RANGE_ADDRESS As String = "$A$1:$F$10" [B][COLOR=#008000]' <= Change this DV range as required[/COLOR][/B]
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sLastOpration As String, sMessageAlert As String
Dim sPaste As String, sAutoFill As String, sDragNDrop As String
With Application
If .LanguageSettings.LanguageID(msoLanguageIDInstall) = 1033 Then ' English
sPaste = "Past": sAutoFill = "Auto Fill": sDragNDrop = "Drag and Drop"
sMessageAlert = "Paste, Auto Fill and Drag&Drop operations are not allowed in range : " & DV_RANGE_ADDRESS
ElseIf .LanguageSettings.LanguageID(msoLanguageIDInstall) = 1036 Then 'French
sPaste = "Coll": sAutoFill = "Recopie Incrémentée": sDragNDrop = "Glisser-déplacer"
sMessageAlert = "Les operations de 'Collage', 'Recopie Incrémentée' et 'Glisser-déplacer' ne sont pas permises dans la plage : " & DV_RANGE_ADDRESS
End If
If Not Intersect(Target, Range(DV_RANGE_ADDRESS)) Is Nothing Then
sLastOpration = .CommandBars.FindControl(ID:=128).Control.List(1)
If Left(sLastOpration, 4) = sPaste Or sLastOpration = sAutoFill Or sLastOpration = sDragNDrop Then
.EnableEvents = False
.Undo
.EnableEvents = True
MsgBox sMessageAlert, vbCritical, "Data Validation."
End If
End If
End With
End Sub