تم التعديل على الكود لمنع هذا الشي
Option Explicit
Dim Old_value
Dim New_value
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Old_value = Target.Cells(1, 1).Value
End Sub
'==============================================
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo Final_Step
If Intersect(Target, Range("A1:F12")) Is Nothing Then GoTo Final_Step
New_value = Target.Value
If Target.Cells.Count > 1 Then
Application.Undo
GoTo Final_Step
End If
If Old_value = "" And Target.Cells.Count > 1 Then
Application.Undo
GoTo Final_Step
End If
If Old_value = "" Then
Target.Value = New_value
Else
Application.Undo
End If
Final_Step:
Application.EnableEvents = True
End Sub