I have been using a piece of code to find specific text within vba modules.
It works well for finding a single line (or less) of text. So, for example it will find 'mySub' in a module with text :
Private sub mySub()
Dim a as Integer
Dim b as Integer
End Sub
The code I am using:
Set m = myAp.Modules(name)
m.find(text_find, 1, 1, -1, -1, False, False, False)
The problem begins when I want to search for multi-line texts. For example I want to find the section of text:
Dim a as Integer
Dim b as Integer
Unfortunately the find function is returning a false when I try presenting my multi-line search text.
Using debug (watch/immediate) I confirmed that my search criteria (text_find) does contain chrs 13 + 10 in between the first 'Integer' and the 'Dim b'.
I also examined the module.Line value for the "Dim a" line, and that also ends with chrs 13 + 10.
So now I am really struggling to know how to get this working.
If anyone has any help on this - would be appreciated.
Thanks