首页 > 应用开发 > IT综合 > excel 中,选中的行,变色
Excel中数据多的时候连自己选择的是那一行也看不清楚,有没有办法让选中行整行变色呢?
在表格的名称上右键选择查看代码,在代码中添加如下代码
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 = 38
End With
End Sub
保存就Ok了
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/197458/viewspace-1051552/ ,如需转载,请注明出处,否则将追究法律责任。