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: 1
Default Recursive Function + File searching to return path


Hey folks, I need a little help.

First and foremost, does Excel VBA support recursive functions/subs?
(IE: can I call a sub from within the same sub?)

Second. Does VBA have a way to browse through file directories? I have
a file Hierarchy, and what I would love is for Excel to start at the
top and for every .xls file it finds, put it in a list in the
spreadsheet calling the 'search' macro. It should return the path of
the file name. Since these spreadsheets are nested within directories,
which are within directories, which are within directories, etc...

In reality, I need a sub that starts in the directory where the file
calling/initiating the sub is saved in. From there, it looks for
(other) .xls files, if it doesn't find any, it will look in the first
directory it sees. From that directory, it will look for a .xls file,
if it finds one, it needs to return the path to that .xls file and add
it to the next available spot on sheet2 of the initiating file. From
there it will search the next directory for excel files or directories
and keep going. Until all directories have been searched and all
'excel' files have been reported for.

I don't entirely know if this makes any sense. I hope it does. It
seemed like it would be more difficult to explain, which leads me to
think I am missing something big.

Anyways this seems like it would be easier if I could 'chat' to someone
about this live over AIM or whatnot (because I may have other questions
as i am going). I don't suppose any excel experts have some sort of
chat handle/program that they can use while going about their business
(I don't want to be an inconvenience). If you don't want to give it out
publicly, please e-mail me with details ). Thanks in
advanced.

I would appreciate any assistance or ideas with the issues above as
well (on these forums). Thanks again!


--
ph8
------------------------------------------------------------------------
ph8's Profile: http://www.excelforum.com/member.php...o&userid=19871
View this thread: http://www.excelforum.com/showthread...hreadid=387116

 
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
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
Is there a function to print file name/path on a spreadsheet? cchas80860 Excel Worksheet Functions 4 April 14th 09 02:35 AM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
close workbook without closing excel and stop recursive function chris Excel Discussion (Misc queries) 3 July 10th 06 08:23 PM
xlDialogOpen get it to return Path DMc2005 Excel Discussion (Misc queries) 1 October 2nd 05 03:47 PM


All times are GMT +1. The time now is 06:14 AM.

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"