Private Sub Worksheet_SelectionChange(ByVal T As Range)
Cells.Interior.ColorIndex = 0
T.EntireRow.Interior.ColorIndex = 7
T.EntireColumn.Interior.ColorIndex = 7
T.Interior.ColorIndex = 2
End Sub
第3个回答 2016-05-19
在查看代码复制以下: Private Sub Worksheet_Change(ByVal Target As Range) If Application.CutCopyMode <> False Then Application.CutCopyMode = False End If Call colorset(Target) End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Application.CutCopyMode = False Then Call colorset(Target) Else Exit Sub End If End Sub Private Sub colorset(ByVal rngtarget As Range) If rngtarget.Count > 1 Then Cells.Interior.ColorIndex = 0 Exit Sub End If Rows.Interior.ColorIndex = 0 x = ActiveCell.Row y = ActiveCell.Column Rows(x).Interior.ColorIndex = 20 Columns(y).Interior.ColorIndex = 35 ActiveCell.Interior.ColorIndex = 15 End Sub本回答被网友采纳