ان شاء الله هيعمل على office 2010
Dim cellState As New Collection
Private Sub Workbook_Open()
Dim ws As Worksheet
Dim cell As Range
For Each ws In ThisWorkbook.Worksheets
For Each cell In ws.UsedRange
If Not IsEmpty(cell.Value) Then
cellState.Add cell.Value, cell.Address
End If
Next cell
Next ws
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
cellState.Clear
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim ws As Worksheet
Set ws = Target.Worksheet
For Each cell In Target
If Not Intersect(cell, ws.UsedRange) Is Nothing Then
If Not IsEmpty(cell.Value) And cell.Value <> cell.Text Then
cell.Interior.Color = RGB(0, 0, 0) ' Black color
cell.Font.Color = RGB(255, 255, 255) ' White color
If cellState.Contains(cell.Address) Then
cellState.Remove cell.Address
End If
cellState.Add cell.Text, cell.Address
End If
End If
Next cell
End Sub