在如何用vba合并word表格的单元格?一文中我们介绍了如何用vba合并word表格中的单元格
在vba中还可以拆分word单元格,拆分单元格用单元格对象的Split方法。
Sub exceloffice()
'作者QQ:1722187970,微信:xycgenius,微信公众号exceloffice
Dim oDoc As Document
Set oDoc = Word.ActiveDocument
Dim oT As Table
Dim oRow As Row
Dim oColumn As Column
Dim oCell As Cell
With oDoc
Set oT = .Tables(1)
With oT
Set oCell = .Cell(2, 3)
'拆分成1行3列
oCell.Split 1, 3
End With
End With
End Sub


发表评论