
ممنون حل شد!

خوب ردیفی رو حذف نکنید تا ارور نده
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim CelValue As Variant
Dim Vtxt As String
On Error GoTo ExitHandeler
Vtxt = Target.Value
Application.EnableEvents = False
CelValue = Target.Value
Application.Undo
If Target.Value <> "" Then
If Target.Value <> CelValue Then
Target.Interior.ColorIndex = 6
Target.Value = CelValue
End If
Else
Target.Value = CelValue
End If
ExitHandeler:
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim CelValue As Variant
Application.EnableEvents = False
CelValue = Target.Value
Application.Undo
On Error GoTo ExitHandeler
If Target.Value <> "" Then
If Target.Value <> CelValue Then
Target.Interior.ColorIndex = 6
Target.Value = CelValue
End If
Else
Target.Value = CelValue
End If
ExitHandeler:
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim CelValue As Variant
Application.EnableEvents = False
CelValue = Target.Value
Application.Undo
If Target.Value <> "" Then
If Target.Value <> CelValue Then
Target.Interior.ColorIndex = 6
Target.Value = CelValue
End If
Else
Target.Value = CelValue
End If
Application.EnableEvents = True
End Sub
Leave a comment: