View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nobody[_4_] Nobody[_4_] is offline
external usenet poster
 
Posts: 7
Default Listing the files from a directory

Try using the FileSystemObject?

"yagna" wrote in message
...
I have about 5 - 6 textfiles which are available in a specific directory,
I
have done a macro to identify these files & convert them to excel files.
Now
I'm in a fix that some time there might be 3 files only or no file in that
folder.

In the Macro, I have refered the file (which is having constant name say
A,B,C...), if these files are available, the macro will open the text file
&
convert them to excel. if say text file B is not available then macro
stops
over here. how should I proceed further.

Alternatively, how should I get the list of text files available in a
particular folder & how this can be displayed in the excel worksheet in a
range.

thanks for the help.

regards,
yagna.