excel closed workbooks

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

drafter

Thread Starter
Joined
Nov 21, 2000
Messages
419
I would like to search for some text in about 15 different closed workbooks. Is this possible?

thanx
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Yes, you can do it while they are closed or open them, search and then close them.
 
Joined
Sep 4, 2003
Messages
4,916
This can easily be done using a VBA macro. Are all the workbooks located in the same directory? Give more details on what you want to do and we can provide more assistance.

Regards,
Rollin
 

drafter

Thread Starter
Joined
Nov 21, 2000
Messages
419
I have about 15 different excel files in the same directrory. I would like to search for a certian string of text.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
drafter, you can use the VBA Function FileSearch to do that, it does not need any special VBA.
If you open the VBA Editor and use it's Help (which is different from the standard Excel Help)
and search for FileSearch it will show you the Code.
If you have a problem I can post it.
 

drafter

Thread Starter
Joined
Nov 21, 2000
Messages
419
The following is the VBA I found. Now what do I do with it?

With Application.FileSearch
If .Execute() > 0 Then
MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."
For i = 1 To .FoundFiles.Count
MsgBox .FoundFiles(i)
Next i
Else
MsgBox "There were no files found."
End If
End With
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Have a look at the attached workbook. the data that you are searching for goes in Cell H1 and you can browse to the Folder containing the Excel files, it can also be set to search sub folders as well.
 

Attachments

OBP

Joined
Mar 8, 2005
Messages
19,895
slurpee, I have an Access version in my Document Management database that you might also like. The Access version does a lot more.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top