怎样设置点击一个excel的单元格,使所在行都改变颜色

2024-11-06 00:42:22
推荐回答(3个)
回答1:

选择行,然后填充,不知道你的软件是03还是07的,我用的是07的

回答2:

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 = 20
End With
End Sub

回答3:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
R = Target.Row
Rows(R).Interior.ColorIndex = 3
End Sub