首页 > 其他 > 详细

excel十字交叉突亮显示

时间:2020-09-10 13:08:18      阅读:57      评论:0      收藏:0      [点我收藏+]
打开excel按照alt+F11(或者打开"开发模式,选择Visual Basic"),选择ThisWorkbook写入如下代码

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Cells.FormatConditions.Delete
    With Target.EntireColumn
        .FormatConditions.Add xlExpression, , "=true"
        .FormatConditions(1).Interior.Color = RGB(253, 255, 200)
    End With
    With Target.EntireRow
        .FormatConditions.Add xlExpression, , "=true"
        .FormatConditions(2).Interior.Color = RGB(253, 255, 200)
    End With
End Sub

效果如下
技术分享图片

选择另外存为xlsm格式即可
技术分享图片

excel十字交叉突亮显示

原文:https://blog.51cto.com/songhl/2530903

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!