
Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Helmut,
This is really slick. Thanks!!
Is there a way to look for both:
.text = "Sub *End Sub" and
.text = "Function *End Function"
within the same search?
I set up 2 searchs which works; however, I loose the sequence that the subs
and functions as they are found in the document.
> Hi Al,
>
[quoted text clipped - 29 lines]
> You may search for chr(13) & "Private Sub "
> You may define the end of a sub as "End Sub" & chr(13) etc.
Helmut Weber - 01 Nov 2007 22:42 GMT
Hi Al,
>Is there a way to look for both:
> .text = "Sub *End Sub" and
> .text = "Function *End Function"
>within the same search?
not in a straightforward way.
However, can all be done,
but then things get really complicated.
No way around two searches, IMHO,
and remembering which one was found where
and comparing the results.
Too convoluted for a speedy tip.

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Al - 02 Nov 2007 01:50 GMT
Thanks Helmut. I got the search working with 2 searches and it's doing what
I need it to do now.
Thanks!!
> Hi Al,
>
[quoted text clipped - 11 lines]
>
> Too convoluted for a speedy tip.
Russ - 04 Nov 2007 07:29 GMT
Al,
As you find each range that contains a sub or function, you could capture
the the range start number, also, to temporarily use in sorting a table by
the range start number.
.....When something is found then
load rDcm.Start along with sTmp & " (" & lPrg & ")" into adjoining table
cells.
Then after all the subroutines and functions are found, the column
containing the range start numbers could be used to sort the table and then
deleted if desired.
A TOC (table of contents) or bookmarks can be used for quickly going to the
start of particular subroutine or function in the document. Or your text in
the cells containing the names could be changed into crossreferences or
hyperlinks to jump to the corresponding text in the document.
> Helmut,
>
[quoted text clipped - 41 lines]
>> You may search for chr(13) & "Private Sub "
>> You may define the end of a sub as "End Sub" & chr(13) etc.

Signature
Russ
drsmN0SPAMikleAThotmailD0Tcom.INVALID