Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.EntireColumn.Address = Target.Address Then
Cells.Interior.ColorIndex = xlNone
Exit Sub
End If
If Target.EntireRow.Address = Target.Address Then
Cells.Interior.ColorIndex = xlNone
Exit Sub
End If
Cells.Interior.ColorIndex = xlNone
Rows(Selection.Row & ":" & Selection.Row + Selection.Rows.Count - 1).Interior.ColorIndex = 20
Columns(Selection.Column).Resize(, Selection.Columns.Count).Interior.ColorIndex = 20
End Sub
Excel VBA 十字变色
最新推荐文章于 2024-12-19 07:00:46 发布