excel如何设置点击任意一个单元格会出现一个十字架标明所点击单元格的横和列

如题所述

打开阅读模式即可,具体操作步骤如下:

1.首先,打开需要编辑的Excel表,然后进入编辑页面。

2.其次,单击以打开主菜单栏中的“视图”选项。

3.然后,单击以在弹出窗口中打开“阅读模式”。

4.最后,任意单击单元格,就会出现一个十字架了。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-12-02

按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,直到出现满意的颜色。以下是截图:

追问

代码怎么就直接复制在单元格?

追答

你按ALT+F11,会出现Microsoft Visual Basic界面,复制我的代码粘贴到右边窗口,OK!

追问

不行呀 按了没有出现什么东西

追答

按住ALT键不放,同时按F11键,F11是一个键。

追问

应该电脑的问题吧 按住ALT+F11 确实是没有反应呢 操作没错的

追答

换种方法:在sheet标签上点击鼠标右键,选择“查看代码”。

追问

能否加一下你的QQ呢方便请教操作

追答

你把文件发给我吧:[email protected]

本回答被提问者和网友采纳
第2个回答  2015-12-02
Private Sub Worksheet_Change(ByVal Target As Range)
If Application.CutCopyMode <> False Then
Application.CutCopyMode = False
End If
Call colorset(Target)
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Application.CutCopyMode = False Then
Call colorset(Target)
Else
Exit Sub
End If
End Sub
Private Sub colorset(ByVal rngtarget As Range)
If rngtarget.Count > 1 Then
Cells.Interior.ColorIndex = 0
Exit Sub
End If
Rows.Interior.ColorIndex = 0
x = ActiveCell.Row
y = ActiveCell.Column
Rows(x).Interior.ColorIndex = 20
Columns(y).Interior.ColorIndex = 35
ActiveCell.Interior.ColorIndex = 15
End Sub追问

具体是怎么操作?直接按ALT+F11 然后复制在单元格里面?

第3个回答  2022-12-07

    在 Excel 中打开一个工作簿。

    按下 Alt + F11 打开 VBA 编辑器。

    在 VBA 编辑器中,单击左侧的“模块”节点,然后在编辑器的主窗口中粘贴上面的代码。

    单击左侧的“工作表”节点,然后双击要添加这段代码的工作表。

    在新窗口中,粘贴以下代码:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' 保存当前选中的单元格的行号和列号

Dim row As Integer

Dim col As Integer

row = Target.Row

col = Target.Column

' 清除之前高亮的行和列

Cells.Interior.ColorIndex = 0

' 高亮当前选中的行和列

Rows(row).Interior.ColorIndex = 6

Columns(col).Interior.ColorIndex = 6

End Sub

第4个回答  2019-12-11

excel:选定单元格出现十字交叉光标,这技能找了好久

相似回答