Excel中实现鼠标用不同颜色定位表格的操作步骤如下:
1、打开需要设置的Excel表格,右键点击工作表,在弹出的菜单中点击“查看代码”
2、进入代码编辑窗口;
3、在指定区域粘贴代码(文章末附代码);
4、代码
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume Next
Cells.FormatConditions.Delete
iColor = 34
With Target.EntireRow.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = iColor
End With
With Target.EntireColumn.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = iColor
End With
End Sub