#1
|
|||
|
|||
Start find macro beginning with section 2
I have a macro that is looking for specific words within a document and runs a find between those two specific words. All that works fine.
The part I would like to know now is, how can I start the find after Section 1 of the document? The reason for starting after Section 1, because those keywords I'm trying to find are in the table of contents. There are only a total of two sections within the document. |
#2
|
|||
|
|||
So where is your macro?
Code:
Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 9/21/2018 Dim oRng As Word.Range Set oRng = ActiveDocument.Sections(2).Range With oRng.Find .Text = "Test" While .Execute oRng.Select Wend End With lbl_Exit: Exit Sub End Sub |
#3
|
|||
|
|||
Thank you Greg for your reply. I have no access to this site from work, so I posted this question thru my phone. Somewhat difficult to post the macro. I can post the macro when I get home, but in the meantime, I will see if I can get what you have posted to work for my needs. Thanks again.
|
#4
|
|||
|
|||
Hi Greg,
Thanks again for you help. I got it to work with you guidance. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to find and replace random empty spaces in beginning of lines? | Pauliina | Word | 4 | 05-24-2018 10:01 PM |
word macro To insert text at the beginning and at end of paragraph | ArieH | Word VBA | 20 | 09-10-2017 04:23 PM |
Word 2013 - When deleting section breaks, cursor jumps to beginning of document | ranholmom66 | Word | 3 | 07-01-2016 06:01 AM |
Find keyword in section & delete section | donaldadams1951 | Word VBA | 5 | 12-03-2013 10:08 AM |
Footnotes in one column section forcing two column section start from a new page... | thorin | Word | 1 | 12-19-2012 01:22 PM |