EXCEL防止看错行列VBA代码
1、打开需要使用防止看错行的工作薄,选中工作表标签,单击鼠标右键,选择“查看代码”进入到VBA工程窗口。


2、将代码复制到需要使用的工作表的代码窗口。

3、代码:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
On Error Resume Next
Cells.FormatConditions.Delete
With Target.EntireRow.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = 24
End With
With Target.EntireColumn.FormatConditions
.Delete
.Add xlExpression, , "TRUE"
.Item(1).Interior.ColorIndex = 24
End With
Selection.FormatConditions.Delete
End Sub
效果如图:

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:142
阅读量:54
阅读量:142
阅读量:53
阅读量:158