作者:乔山办公网日期:
返回目录:office365
1、首先打开excel表格,在表格上抄方的工具栏中找到“视图”选项。
2、点击进入“视图”后,找到其中的袭“阅读模式”选项。
3、然后点击“阅读模式”的下拉菜单,选择需要高亮显示zd的颜色,例如选择黄色。
4、选择后点击页面中任意单元格,可以看到横行和竖列都会显示同一颜色的高亮。
按ALT+F11,输入如下代码(建议复制粘贴,不易出现手误):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.EntireColumn.Address = Target.Address Then
Cells.Interior.ColorIndex = xlNone
Exit Sub
End If
If Target.EntireRow.Address = Target.Address Then
Cells.Interior.ColorIndex = xlNone
Exit Sub
End If
Cells.Interior.ColorIndex = xlNone
Rows(Selection.Row & ":" & Selection.Row + Selection.Rows.Count - 1).Interior.ColorIndex = 10
Columns(Selection.Column).Resize(, Selection.Columns.Count).Interior.ColorIndex = 10
End Sub
自己可以改ColorIndex,直到出现满意的颜色。以下是截7a686964616fe4b893e5b19e332图:
右键zhidao当前工作表名称(下方的标专签)---查看代码--把下列代码复制进去即属可!
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 = vbRed
End With
End Sub
Alt+F11打开VBE编辑器,双击对应的工作表对象抄,复制粘贴下面的代码后袭,在工作表中选中单元格zd时显示带颜色的十字。
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlColorIndexNone
With Target
.EntireRow.Interior.Color = vbBlue
.EntireColumn.Interior.Color = vbBlue
End With
End Sub