怎样打开VBA编辑器的工具栏,方便使用功能?

 时间:2026-02-14 04:52:48

1、首先在开发工具中打开VBA编辑器

怎样打开VBA编辑器的工具栏,方便使用功能?

2、在单元格区域当中输入一些内容作为例子

怎样打开VBA编辑器的工具栏,方便使用功能?

3、在VBA编辑器中插入模块

怎样打开VBA编辑器的工具栏,方便使用功能?

4、在模块当中输入如下代码,

Sub 填充代码区域空白单元格()


Dim i As Long, rng As Range
Range("A1:K12000").Activate     '激活一个区域,也可以使用鼠标选择一个区域,然后省了这句
'For Each i In Selection
  'If i = "SHI" Or i = "线名" Then
    'i.Offset(-1).RowHeight = 35
    'Cells(1, 11).ColumnWidth = 10
    'ActiveWindow.RangeSelection.ColumnWidth = w
    'ActiveWindow.RangeSelection.RowHeight = h
  'End If
'Next
For i = 0 To 100
    Rows(1 + i * 8).RowHeight = 30
    Rows(2 + i * 8).RowHeight = 35
    Rows(2 + i * 8).Font.Size = 18
    Rows(3 + i * 8).RowHeight = 30
    Rows(3 + i * 8).Font.Size = 11
    Rows(4 + i * 8).RowHeight = 30
    Rows(4 + i * 8).Font.Size = 11
    Rows(5 + i * 8).RowHeight = 30
    Rows(5 + i * 8).Font.Size = 11
    Rows(6 + i * 8).RowHeight = 245
    Rows(7 + i * 8).RowHeight = 245
    Rows(8 + i * 8).RowHeight = 30
    Columns(1).ColumnWidth = 0
    Columns(2).ColumnWidth = 6
    Columns(3).ColumnWidth = 6
    Columns(4).ColumnWidth = 9
    Columns(5).ColumnWidth = 9
    Columns(6).ColumnWidth = 9
    Columns(7).ColumnWidth = 10
    Columns(8).ColumnWidth = 10
    Columns(9).ColumnWidth = 10
    Columns(10).ColumnWidth = 10
Range("B" & (2 + i * 8) & ":J" & (2 + i * 8)).Merge
    With Range("B" & (2 + i * 8))
        .Value = "涵洞设备卡片"
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        '.Font.Bold = True
        .Font.Bold = False
        .Font.Name = "黑体"
    End With
Range("B" & (3 + i * 8) & ":C" & (3 + i * 8)).Merge
    With Range("B" & (3 + i * 8))
        .Value = "设备编号:"
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .Font.Bold = False
        .Font.Name = "宋体"
    End With
    With Range("D" & (3 + i * 8))
        .Value = Sheet2.Range("E" & (2 + i)).Value
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .Font.Bold = False
        .Font.Name = "宋体"
    End With
    With Range("B" & (4 + i * 8))
        .Value = Sheet2.Range("F1").Value
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .Font.Bold = False
 

怎样打开VBA编辑器的工具栏,方便使用功能?

5、接着我们点击上传功能区当中的视图,然后在列表当中我们点击工具栏,找到编辑工具,点击打开,

怎样打开VBA编辑器的工具栏,方便使用功能?

6、最后在页面右上角的位置,我们就可以看到编辑工具栏了,我们还可以活动来调节编辑工具栏的位置,方便我们使用,

怎样打开VBA编辑器的工具栏,方便使用功能?

  • 如何利用VBA代码插入数据
  • 在excel中增加、删除、有条件添加批注的vba代码
  • 怎样使用VBA选择粗线边框之单元格?
  • Excel工作表如何快速跳转到指定区域技巧!
  • 在VBA编程里面怎样打开一个新的工作薄?
  • 热门搜索
    感冒清热冲剂 安徽地质博物馆 轮胎规格怎么看 认真的近义词是什么 锡纸烫发型 稀有克隆装扮怎么用 感冒后咳嗽一直不好 奉献的近义词 江苏省博物馆 微博怎么看最近访客