操作方法
在需要的Excel左下方工作表处点击右键;选择右键菜单【查看代码】
将以下代码复制到编辑框内;Private Sub Worksheet_SelectionChange(ByVal Target As Range)Cells.Interior.ColorIndex = 2Rows(Target.Row).Interior.ColorIndex = 35 '设置行颜色值Columns(Target.Column).Interior.ColorIndex = 35 '设置列颜色值End Sub 如下图所示
保存即可