LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default counting excel files

One way is to use DIR with a loop....

Sub Macro()
Dim strFolder As String, strFile As String
Dim intCount As Integer
strFolder = "d:\"
strFile = Dir(strFolder & "*.xls", vbNormal)
Do While strFile < ""
intCount = intCount + 1
strFile = Dir
Loop
MsgBox intCount & " files found"
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"dstiefe" wrote:

How do I count excel files that are not open

I want to put excel files in a folder ...then I want to first count the
number of files that are in the folder...

then open them

Thank you

 
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
Counting files in a folder Hawki Excel Programming 7 April 14th 04 05:54 PM
counting files in a folder jefe Excel Programming 2 March 2nd 04 07:36 PM
Counting files using Loop Ron[_13_] Excel Programming 0 October 28th 03 07:45 PM
Counting files using Loop Ron[_13_] Excel Programming 0 October 28th 03 07:45 PM
Counting files using Loop Ron[_13_] Excel Programming 0 October 28th 03 07:45 PM


All times are GMT +1. The time now is 09:42 AM.

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

About Us

"It's about Microsoft Excel"