Excel 怎么设置 选中一个单元格后,整行/整列的颜色都变化
1个回答
展开全部
这个需要利用VBA代码来实现
步骤如下:
按ALT+F11,在右边窗口中输入如下代码(建议复制粘贴,防止手误)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Target
.Parent.Cells.Interior.ColorIndex = xlNone
.EntireRow.Interior.Color = vbGreen
.EntireColumn.Interior.Color = vbCyan
.Interior.Color = vbWhite
End With
End Sub
步骤如下:
按ALT+F11,在右边窗口中输入如下代码(建议复制粘贴,防止手误)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Target
.Parent.Cells.Interior.ColorIndex = xlNone
.EntireRow.Interior.Color = vbGreen
.EntireColumn.Interior.Color = vbCyan
.Interior.Color = vbWhite
End With
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询