Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Greg B...
 
Posts: n/a
Default Load all files in a directory

I would like to load all my .xls file, How would I do this please.


Thanks again

Greg


  #2   Report Post  
Jim May
 
Posts: n/a
Default

I have the below in a standard module of a surrogate file xyz.xls:
I open xyz; Run the Macro, then Close xyz;

Sub OpenMyFiles()
Dim sPath As String, sName As String
Dim bk As Workbook
sPath = "C:\My Documents\MyFavoriteFiles\"
sName = Dir(sPath & "*.xls")
Do While sName < ""
Set bk = Workbooks.Open(sPath & sName)
' . . . process bk
' bk.Close Savechanges:=False ' or true
sName = Dir
Loop
End Sub



"Greg B..." wrote in message
...
I would like to load all my .xls file, How would I do this please.


Thanks again

Greg




  #3   Report Post  
Greg B...
 
Posts: n/a
Default

Thanks Jim, just what I wanted

Greg


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
Cannot access read-only documents. tomgillane Excel Discussion (Misc queries) 14 February 7th 05 11:53 PM
change directory for refresh data TxRaistlin Excel Discussion (Misc queries) 0 February 7th 05 10:09 PM
my files won't load completely in excel Emilee Excel Discussion (Misc queries) 1 February 3rd 05 01:57 AM
importing multiple text files URGENT!!! HELP tasha Excel Worksheet Functions 0 December 19th 04 05:26 PM
importing multiple text files??? tashayu Excel Discussion (Misc queries) 0 December 19th 04 03:43 PM


All times are GMT +1. The time now is 11:47 AM.

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"