Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Needle in a haystack...searching for VBA code in all Excel sheets or     finding xls users of xla sheets....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CodeMonkey - 28 May 2008 17:14 GMT
I can't think of a way but I hope there is one where I can search a
directory of Excel sheets for a function call.  Or ones that use
certain xla files.

Otherwise, I have to pull out my hair.

THANKS

John
Gary''s Student - 28 May 2008 18:10 GMT
Let's say we have a group of workbooks in a folder and we suspect that on
some sheet of some workbook the function =SUM() is being used.  We want to
find the workbook, the sheet, and the cell holding the function:

1. open the workbooks in the folder
2. run the following:

Sub findit()
For Each wb In Workbooks
   wb.Activate
   For Each sh In wb.Sheets
       sh.Activate
       For Each r In sh.UsedRange
           v = r.Formula
           If InStr(v, "SUM(") > 0 Then
               r.Select
               Exit Sub
           End If
       Next
   Next
Next
End Sub

Clearly this code can be modified to open each workbook in series.
Signature

Gary''s Student - gsnu2007i

> I can't think of a way but I hope there is one where I can search a
> directory of Excel sheets for a function call.  Or ones that use
[quoted text clipped - 5 lines]
>
> John
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.