Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Count files in a Folder!

Hi Don.

Thanks a lot. But, if instead of the message Box the
value "returns" to a cell, how would the programing Be?

Thankīs a lot!!
SpeeD



-----Original Message-----
try this

Sub filescount()
Set fs = Application.FileSearch
With fs
.LookIn = "C:\a"
.SearchSubFolders = True
.Filename = "*.*"
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


End Sub
"SpeeD72" wrote in message
...
Hi guys.

How can a make a formula that gives me the "count" of
files in a Folder?

If it insīt possible in a formula can i make a macro that
gives me this "Count" in a cell? how?

Thanks a lot
SpeeD72


.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Count files in a Folder!

MsgBox "There were " & .FoundFiles.Count & _
" file(s) found."

range("a1")=.foundfiles.count

"SpeeD72" wrote in message
...
Hi Don.

Thanks a lot. But, if instead of the message Box the
value "returns" to a cell, how would the programing Be?

Thankīs a lot!!
SpeeD



-----Original Message-----
try this

Sub filescount()
Set fs = Application.FileSearch
With fs
.LookIn = "C:\a"
.SearchSubFolders = True
.Filename = "*.*"
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


End Sub
"SpeeD72" wrote in message
...
Hi guys.

How can a make a formula that gives me the "count" of
files in a Folder?

If it insīt possible in a formula can i make a macro that
gives me this "Count" in a cell? how?

Thanks a lot
SpeeD72


.



Reply
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
Pulling pdf files from general folder to specific folder [email protected] Excel Discussion (Misc queries) 2 September 8th 09 09:41 PM
Count files in a folder Wanna Learn Excel Discussion (Misc queries) 4 July 9th 08 05:46 PM
Copying all files in a folder to new folder michaelberrier Excel Discussion (Misc queries) 2 June 20th 06 05:35 AM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 04:28 PM
Count files in a Folder! Bob Phillips[_5_] Excel Programming 0 September 11th 03 06:38 PM


All times are GMT +1. The time now is 03:31 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"