View Single Post
 
Old 10-03-2019, 03:52 PM
fly545 fly545 is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2019
Posts: 6
fly545 is on a distinguished road
Default

hi Guessed,

that seems like it would work to copy my tables (no problem with adding in those additional paragraphs)

but it doesn't cover the "look" function that i would like to use, where i find the heading title and then copy the table beneath.

here is an example of the code i was trying to make work (assuming those paragraphs weren't there), note, it doesn't work and the code gets stuck on the first selection criteria.


With Selection.Find
.Text = "Data A"
.Style = "Heading 2a"
.Execute

If .Found Then

End If
End With

With Selection
.MoveDown Unit:=wdLine, Count:=1
.Tables(1).Range.Select
.Copy
.MoveDown Unit:=wdLine, Count:=1
.MoveDown Unit:=wdLine, Count:=1
.TypeParagraph
.MoveUp Unit:=wdLine, Count:=1
.Style = ActiveDocument.Styles("SEW body text")
.TypeParagraph
.PasteAndFormat (wdFormatOriginalFormatting)
End With
Reply With Quote