Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search VBA code for several words

Status
Not open for further replies.

MrStar

Programmer
Sep 30, 2002
53
DK
I need to search my VBA code for several different functions such as curdir(), instr() and so on.

Does anybody know a way to to do it through some VBA code ?
I could of course use the normal search dialog, but it can only take one word in a search.

I guess I will have a table with all the words I would like o find in my code, at then call a VBA function, that can scan all VBA code in a database for alle the words in the table.
 
Edit > Find not good enough?
You can check Current Project to search everything with VBA.

-Pete
 
How can I use edit/find on VBA projects ?
 
View your VBA code, On the toolbar click Edit, Go down and click Find.

Are you trying to execute this at runtime? Or just for right now being the only time. This will only work if you want to use it this time only.



-Pete
 
Modules have a find method:
Microsoft said:
...
' Search for string.
If mdl.Find(strSearchText, lngSLine, lngSCol, lngELine, _
lngECol) Then ...
 
I was saying Edit > Find will only work before runtime.


-Pete
 
Bit of confusion, I though I was just tacking a note after your fisrt post, snyperx3, not commenting on a subsequent post! [dazed]
 
Thanks Remou.
It works fine. Now I have a function that can search all modules (including modules in forms and reports) for several words in same search.
 
MrStar-Care to post your code for the search. It sounds like something many of us could use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top