如何让在excel中被选中的单元格所在的行和列高亮显示
1个回答
展开全部
Private Sub Worksheet_SelectionChange(ByVal Target AsExcel.Range)
Cells.Interior.ColorIndex = xlNone
Target.Offset(, 1 - Target.Column).Resize(1, 2).Interior.ColorIndex= 34
S = Target.Column
If Columns(S).Interior.ColorIndex = 6 Then
Columns(S).Interior.ColorIndex = 0
Else
Columns(S).Interior.ColorIndex = 6
End If
End Sub
Cells.Interior.ColorIndex = xlNone
Target.Offset(, 1 - Target.Column).Resize(1, 2).Interior.ColorIndex= 34
S = Target.Column
If Columns(S).Interior.ColorIndex = 6 Then
Columns(S).Interior.ColorIndex = 0
Else
Columns(S).Interior.ColorIndex = 6
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询