Jacobingram
Registered User.
- Local time
- Today, 07:29
- Joined
- Sep 15, 2004
- Messages
- 13
I have a piece of file counting code :
What I would like though is for the ".LookIn" to search in multiple folders, as stipulated by a certain field in a table of mine. I have a list of 'prospects' in a table, each with its own unique folder. Ideally, I would like it to count the files in each separate folder and return the results to the table in another field.
Eg/ Prospect 1 - c:/prospect 1 - 120 files
How might I do this? I am relatively inexperienced in VBA but am starting to get the hang of it!
Thanks
Code:
Private Function filesearch()
Set fs = Application.filesearch
With fs
.LookIn = "C:\Windows"
.FileName = "*.*"
.searchsubfolders = True
fs.Execute
Dim filecount As Integer
filecount = fs.Execute
MsgBox (filecount)
End With
End Function
What I would like though is for the ".LookIn" to search in multiple folders, as stipulated by a certain field in a table of mine. I have a list of 'prospects' in a table, each with its own unique folder. Ideally, I would like it to count the files in each separate folder and return the results to the table in another field.
Eg/ Prospect 1 - c:/prospect 1 - 120 files
How might I do this? I am relatively inexperienced in VBA but am starting to get the hang of it!
Thanks