Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Status Bar...

I am using the following code to identify the filenames in
a specified directory:

myFNames = Dir("*.xls")

Is there any way of counting how many files this
comprises? I want to have the status bar showing an
update of what is going on behind the scenes...

Hope you can help!

Many thanks,
James

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Status Bar...

Maybe this will help

http://tinyurl.com/qrbr
"James Weaver" wrote in message
...
I am using the following code to identify the filenames in
a specified directory:

myFNames = Dir("*.xls")

Is there any way of counting how many files this
comprises? I want to have the status bar showing an
update of what is going on behind the scenes...

Hope you can help!

Many thanks,
James



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Status Bar...

One way

Sub test()
Dim foldername As String
foldername = "C:\Data"
With Application.FileSearch
.NewSearch
.LookIn = foldername
.SearchSubFolders = False
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
MsgBox .FoundFiles.Count & " Excel files were found"
Else
MsgBox "There were no files found."
End If
End With
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"James Weaver" wrote in message ...
I am using the following code to identify the filenames in
a specified directory:

myFNames = Dir("*.xls")

Is there any way of counting how many files this
comprises? I want to have the status bar showing an
update of what is going on behind the scenes...

Hope you can help!

Many thanks,
James



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Status Bar...

James,

Try using FileSearch

With Application.FileSearch
.NewSearch
.LookIn = "d:\Bob\My Documents\My Spreadsheets"
.SearchSubFolders = False ' True to include subfolders
.Filename = "*.xls"
.MatchTextExactly = True
.FileType = msoFileTypeExcelWorkbooks
.Execute
myFNames = .FoundFiles.Count
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"James Weaver" wrote in message
...
I am using the following code to identify the filenames in
a specified directory:

myFNames = Dir("*.xls")

Is there any way of counting how many files this
comprises? I want to have the status bar showing an
update of what is going on behind the scenes...

Hope you can help!

Many thanks,
James



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
reuest formula for auto update status & status date PERANISH Excel Worksheet Functions 5 June 2nd 08 04:26 PM
Tax Status charline Excel Worksheet Functions 2 September 8th 06 11:00 PM
Status Bar Reese85 Excel Discussion (Misc queries) 1 June 1st 06 06:11 PM
Status Changes NL Excel Worksheet Functions 2 April 2nd 06 07:27 PM
What is EN on status bar? gman100 Excel Discussion (Misc queries) 3 June 14th 05 11:40 PM


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