|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
快下班了,先给你一个半成品,明天上班了再搞批量打开自动运行保存的
Sub 页眉表格()
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
With ActiveDocument.Sections(1)
a1 = .Headers(wdHeaderFooterPrimary).Range.Tables(1).cell(1, 2)
a2 = Split(a1, Chr(13))(0)
b1 = .Headers(wdHeaderFooterPrimary).Range.Tables(1).cell(2, 3)
b2 = Split(b1, Chr(13))(0)
End With
With ActiveDocument.Tables(1)
c1 = .cell(4, 2)
c2 = Split(c1, Chr(13))(0)
.cell(4, 2).Range = a2 & b2 & c2
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
|
|