【问题标题】:Automatic Highlighting Code自动高亮代码
【发布时间】:2014-08-16 08:16:11
【问题描述】:

我从谷歌得到这个代码。我想知道如何才能使代码不会删除用户以前或新的突出显示。

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
' Clear the color of all the cells
Cells.Interior.ColorIndex = 0
With Target
    ' Highlight the entire row and column that contain the active cell
    .EntireRow.Interior.ColorIndex = 36
    .EntireColumn.Interior.ColorIndex = 36
End With
Application.ScreenUpdating = True
End Sub

【问题讨论】:

    标签: excel vba highlight


    【解决方案1】:

    删除这一行:

    Cells.Interior.ColorIndex = 0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-13
      • 2014-03-02
      相关资源
      最近更新 更多