展开全部
按ALT+F11,输入如下代码(建议复制粘贴,不易出现手误):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 = 10
Columns(Selection.Column).Resize(, Selection.Columns.Count).Interior.ColorIndex = 10
End Sub
自己可以改ColorIndex,直到出现满意的颜32313133353236313431303231363533e59b9ee7ad9431333337626132色。以下是截图: