To answer your second question first - you cannot undo a marco
Try this version:
Sub auto_open()
DerCell = Selection.Range("A2").End(xlDown).Address
Set MyPlage = Selection.Range("A2:" & DerCell)
Dim MyDate As Date
MyDate = Now + 7
For Each Cell In MyPlage
Set colRange = Range(Cells(Cell.Row, 1), Cells(Cell.Row, 3))
If Cell.Value = [D10] Then
colRange.Font.ColorIndex = [D10].Font.ColorIndex
colRange.Interior.ColorIndex = [D10].Interior.ColorIndex
End If
If Cell.Value = [D11] Then
colRange.Font.ColorIndex = [D11].Font.ColorIndex
colRange.Interior.ColorIndex = [D11].Interior.ColorIndex
End If
If Cell.Value = [D12] Then
colRange.Font.ColorIndex = [D12].Font.ColorIndex
colRange.Interior.ColorIndex = [D12].Interior.ColorIndex
End If
Set colRange = Nothing
Next
End Sub
Bookmarks