第2个回答 2010-07-06
工具->宏->Visual Basic 编辑器,在编辑器的左边栏里双击想要这种效果的sheet名,在右边栏里粘贴下面的代码,保存即可
Dim x As Integer
Dim y As Integer
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If x > 0 Then Rows(x).Interior.ColorIndex = xlNone
If y > 0 Then Columns(y).Interior.ColorIndex = xlNone
Rows(Target.Row).Interior.ColorIndex = 6
Columns(Target.Column).Interior.ColorIndex = 6
x = Target.Row
y = Target.Column
End Sub本回答被提问者采纳