Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default List files in a directory

Hi Group,

I am trying to get a list of files in the directory c:/Documents and
setting/My Documents/TestExcel

and open all of them.

Thanks,
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default List files in a directory

Sub FindFiles()
Dim strFile
Dim strFolder

strFolder = "c:\Documents and setting\My Documents\TestExcel\"
strFile = Dir(strFolder & "*.*", vbNormal)
Do While strFile < ""

Msbgox strFile
'do something

strFile = Dir
Loop

End Sub

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


"David" wrote:

Hi Group,

I am trying to get a list of files in the directory c:/Documents and
setting/My Documents/TestExcel

and open all of them.

Thanks,
David

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default List files in a directory

Hi Jacob,

Thank you very much, this is perfect!

Sincerely,
David

"Jacob Skaria" wrote:

Sub FindFiles()
Dim strFile
Dim strFolder

strFolder = "c:\Documents and setting\My Documents\TestExcel\"
strFile = Dir(strFolder & "*.*", vbNormal)
Do While strFile < ""

Msbgox strFile
'do something

strFile = Dir
Loop

End Sub

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


"David" wrote:

Hi Group,

I am trying to get a list of files in the directory c:/Documents and
setting/My Documents/TestExcel

and open all of them.

Thanks,
David

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
List all files in a sub directory KateB[_2_] Excel Programming 4 March 11th 09 06:30 PM
Combo box with list of xls files in a directory excelguy Excel Discussion (Misc queries) 0 November 27th 06 02:53 PM
List of Files in A Directory JaneC Excel Discussion (Misc queries) 2 February 18th 06 12:11 PM
List Files in a Directory [email protected] Excel Programming 3 December 18th 05 12:13 AM
Directory List of Excel Files No Name Excel Programming 6 May 18th 04 05:22 PM


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