1、首先在开发工具中打开VBA编辑器
2、在单元格区域当中输入一些内容作为例子
3、在VBA编辑器中插入模块
4、在模块当中输入如下代码,然后运行Sub 选择粗线边框之单元格() On Error Resume Next Dim rng As Range, rg As Ran爿讥旌护ge For Each rng In ActiveSheet.UsedRange If rng.Borders(xlEdgeRight).Weight = xlMedium And rng.Borders(xlEdgeTop).Weight = xlMedium _ And rng.Borders(xlEdgeBottom).Weight = xlMedium And rng.Borders(xlEdgeLeft).Weight = xlMedium Then If rg Is Nothing Then Set rg = rng Else Set rg = Application.Union(rg, rng) End If End IfNextrg.SelectEnd Sub
5、使用快捷键Alt+F8调出运行宏窗口,然后单击“执行”按钮,可以看到所有加粗实线边框之单元格已被选中