admin管理员组

文章数量:1530965

2024年6月28日发(作者:)

VBA用码-EXCEL常代

EXCEL VBA常用代码

1.显示活动工作簿名称

MsgBox "当前活动工作簿是" &

2.保存活动工作簿

3.保存所有打开的工作簿关闭EXCEL

For Each W in oks

Next W

4.将网格线设置为蓝色

neColorIndex = 5

5.将工作表sheet1隐藏

e = xlSheetVeryHidden

6.将工作表Shtte1显示

e = xlSheetVisible

7.单击某单元格,该单元格所在的行以蓝色背景填充,字体颜色为白色

Private Sub Worksheet_SelectionChange(ByVal Target As )

If >= 2 Then

’第二行以下的区域

On Error Resume Next

[ChangColor_With1].

= "ChangColor_With1"

With [ChangColor_With1].FormatConditions

.Delete

.Add xlExpression, , "TRUE"

.Item(1).ndex = 5

.Item(1).ndex = 2

本文标签: 工作蓝色活动