LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Loping through files in a folder

Excel 2003
From my notes I have: (PathOnlySource is the full path to the folder holding
the files)
ChDir PathOnlySource
TheFile = Dir(PathOnlySource & "\*.xls")
Do While TheFile < ""
TheFile = Dir
MsgBox TheFile
Loop

I thought that the line:
TheFile = Dir(PathOnlySource & "\*.xls")
would get the first .xls file name in the folder, which it appears to be
doing. And I thought that the line:
TheFile = Dir
Would get subsequent file names which it appears it doesn't do. Where am I
going wrong? Thanks for your help. Otto


 
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
Name of files in a folder Irfan Khan[_2_] Excel Discussion (Misc queries) 2 August 26th 08 08:32 AM
Check if a folder has x files in it. Dave Excel Discussion (Misc queries) 8 November 15th 07 03:35 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 03:28 PM


All times are GMT +1. The time now is 12:02 PM.

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"