How can I delete lines between bookmarks

J

Jeffrey Grantz

Please help.

I have a document that contains a large table (8 pages long) and the
table has a number of bookmarks. All these bookmarks are at the start
of a row. Given 2 bookmarks, how can I delete all the rows in
between?

Thanks for any help.
 
D

DaveLett

Hi Jeffrey,
You can use something like the following:

Dim oRng As Range
Set oRng = ActiveDocument.Bookmarks("Test1").Range
With oRng
.MoveStart Unit:=wdRow, Count:=1
.End = ActiveDocument.Bookmarks("Test2").Range.Start
.Rows.delete
End With

HTH,
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top