+ -
当前位置:首页 → 问答吧 → 如何用宏修改大量表格边框?

如何用宏修改大量表格边框?

时间:2011-03-21

来源:互联网

一份文档中有400个表格,每个表格内的框随机分两种粗细。现在需要把其中的粗线变得更粗。如何用宏实现?依次取到每一个单元格的边框并修改。
附件中只给出了三个表格。
谢谢帮助!!

附件

sample.rar(2.94 KB)

2011-3-21 18:27, 下载次数: 7

作者: geogyyee   发布时间: 2011-03-21

400多个表估计要几分钟吧 ,想不到不循环的办法
复制内容到剪贴板
代码:
Sub test()
Application.ScreenUpdating = False
Dim tb As Table, bd As Border, cel As Cell
For Each tb In Tables
    For Each cel In tb.Range.Cells
        For Each bd In cel.Borders
            If bd.LineWidth = wdLineWidth150pt Then bd.LineWidth = wdLineWidth225pt
        Next
    Next
Next
Application.ScreenUpdating = True
End Sub

作者: honggexjq   发布时间: 2011-03-22