打开EXCEL 进入VBA 双击对应的工作表 将代码复制进去
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Cells.FormatConditions.Delete
With Target.EntireRow.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = 3
End With
With Target.EntireColumn.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = 3
End With
End Sub