|
还好,还好。楼主,不好意思,发了几句牢骚。其实昨晚我重新思考了一下,已经有了答案。那就是,查找“仪表位号”即可,然后下一单元格的值自然就得到了!请试用下面的代码(有无分节符及几个表格都无所谓了,不过,我只测试了前 3 个表格的值是正确的,请 楼主 自行检查吧!):
- Sub aaaa单元格批量复制_New()
- Dim s$, i$
- With ActiveDocument
- With .Content.Find
- .ClearFormatting
- .Text = "仪表位号"
- .Forward = True
- .MatchWildcards = True
- Do While .Execute
- With .Parent
- s = .Cells(1).Range.Next.Cells(1).Range.Text
- s = Left(s, Len(s) - 2)
- i = i & "/" & s
- End With
- Loop
- End With
- .Close SaveChanges:=wdDoNotSaveChanges
- End With
- Documents.Add.Content.Text = i
- With ActiveDocument
- .Content.Find.Execute "/", , , 1, , , , , , "^p", 2
- .Characters(1).Delete
- End With
- ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
- MsgBox "处理完毕!文档尚未保存!", 0 + 16
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|