Excel点击改变一行的颜色

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_17255515/article/details/79785358


在查看代码中 添加一下代码:

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

On Error Resume Next

Cells.FormatConditions.Delete

With Target.EntireRow.FormatConditions

.Delete

.Add xlExpression, , "TRUE"

.Item(1).Interior.ColorIndex = 7

End With

End Sub

 
 

Excel Interior.ColorIndex色彩列表


猜你喜欢

转载自blog.csdn.net/qq_17255515/article/details/79785358