LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Need Help with a File Search

Hello,
I have a situation that I can't figure out how to accomplish. I have a
folder that currently has about 310 excel files in it. The file names
are mostly random. In the end what I need to do is find out the contents
of a particular cell in each file. The cell I need is a constant one, it
is K38 in each file. Once I have this information, I need to put that
value into appropriate cells in the workbook I'm coding in.
Currently I'm using a file search(the code is a direct cut from the
Visual Basic help)
Private Sub CommandButton1_Click()
Set fs = Application.FileSearch
With fs
.LookIn = "P:\Test"
.Filename = "*.xls"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 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
End Sub

However, all this does is inundate the workbook with message boxes
telling me the file names. I've tried to get that data dumped into
cells, but have no luck. Any ideas? If you need clarification just ask.
Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
file search or search files Richad Excel Discussion (Misc queries) 0 October 22nd 09 07:56 PM
Search a FAQ file Jane Excel Worksheet Functions 1 October 18th 06 09:07 PM
Turning a text file name into a search and linking the file as a hyperlink AlistairM Excel Discussion (Misc queries) 1 January 26th 06 04:55 AM
File Search mburkett Excel Programming 2 March 15th 05 01:13 AM
Macro to search from one file & place on another file. Luong[_2_] Excel Programming 0 May 6th 04 04:53 PM


All times are GMT +1. The time now is 06:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"