LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Subteam
 
Posts: n/a
Default How to decide folder-depth or How to select more folders/subfolders (folder-tree) ?

Hello to you all,

I have got some VBA code that allows a user (mainly me) to select a folder
on which I will do some renaming en converting of data. (also in VBA-excel)

Folder structure can be eg:
C:\Afolder\Bfolder\Cfolder\Dfolder\Efolder

If you select DFolder ... my code will do its thing on all Efolders.
Efolder is always the same structure (contains alos subfolder) but amount of
Efolders can vary.

If user selects Bfolder or Cfolder my code doesn't work because I only look
one subfolder deep.

I have used the following code to look into subfolder:

Dim fl
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(FolderName) ' FolderName is retrieved by some
other code
Set fc = f.SubFolders
For Each f1 In fc
'Do my thing
Next

Is there a variable in VBA or this object which tells you how deep the
folders list is?
In other words ... how many subfolder levels there are?

Or is this done by going down the path of subfolders and just count it your
self?



EVEN better or ALSO LOOKING FOR:

Is there an object/dialog within VBA that show you the folder tree structure
and allows you to select / deselect folders on which you can run your code.

(if possible ... for Excel2000 or show me the way for ExcelXP and I will try
to translate it)



Many Thanks in Advance


Kimball


 
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
Need to create chart from data in 2 columns and not sure how. Stacey Charts and Charting in Excel 3 February 9th 06 03:07 PM
Need to compare data in 2 columns and not sure how. Stacey Charts and Charting in Excel 0 February 8th 06 04:47 PM
allow user to select folder jbhoop Excel Discussion (Misc queries) 3 January 3rd 06 10:10 PM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM


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