求Excel2007单元格鼠标选中变色代码

2025-03-06 04:05:37
推荐回答(1个)
回答1:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume Next
Cells.FormatConditions.Delete
With Target.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = 35
End With
End Sub