Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Select multipler folders?

Does Excel have a built-in dialog box that will allow
users to select multiple folders within the same directory?
Once the user selects a set of folders, my goal will be
to copy a file (or files) into each folder that was chosen.

Thanx



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Select multipler folders?

Does Excel have a built-in dialog box that will allow
users to select multiple folders within the same directory?
Once the user selects a set of folders, my goal will be
to copy a file (or files) into each folder that was chosen.

Thanx


AFAIK, msoFileDialogFolderPicker doesn't support multi-select. Perhaps
a userform with a directory tree and a listbox is one way to go, where
the user can add selected paths to the listbox for batch processing.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Select multipler folders?

Hmm.., seems you need a Visual Studio license to use the directory
control.

You could list all the subfolders under a specific parent folder in a
check style, multi-select listbox. This requires you (optionally) set
the parent folder in the normal way, then run a drill-down routine to
list that folder's subfolders in the listbox. Users can check the
folders to include for the batch processing.

Idea:
Have the userform prompt for parent folder in its 'Initialize' event.
This gives an abort option if no folder is selected.

When folder is chosen, list its subfolders and display the userform.

Provide a button for users to cancel.

Provide a button to call your batch processing routine.

FWIW:
One of my file lister utilities recursively drills down a top level
folder for subfolder using FileSystemObject. It could be easily
modified for your use with this scenario...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Select multipler folders?

"GS" wrote:

Idea:
Have the userform prompt for parent folder in its 'Initialize' event.
This gives an abort option if no folder is selected.

When folder is chosen, list its subfolders and display the userform.

Provide a button for users to cancel.

Provide a button to call your batch processing routine.


Yup, I pretty much had the same idea too. I have a loop that
reads just the folder names inside C:\Data. I will then add each
folder name string into the listbox by calling ListBox1.AddItem. The
user will then be able to select multiple folders. It turned out
to be easier than I expected.

Thanks Gary!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Select multipler folders?

That's great!

I decided to add a routine to my collection that just lists subfolder
paths under a parent folder in a userform. You're welcome to check it
out...

https://app.box.com/s/23yqum8auvzx17h04u4f

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Select multipler folders?


"GS" wrote

I decided to add a routine to my collection that just lists subfolder
paths under a parent folder in a userform. You're welcome to check it
out...

https://app.box.com/s/23yqum8auvzx17h04u4f


Oh wow, that is very nice. It uses less code than my solution.
Thanks, I'm gonna study this further.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Select multipler folders?


"GS" wrote:

I decided to add a routine to my collection that just lists subfolder
paths under a parent folder in a userform. You're welcome to check it
out...

https://app.box.com/s/23yqum8auvzx17h04u4f


If the listbox gets filled with more than 100+ listbox items, it
will become rather tedious manually checking off or selecting
all items in the list. What methods do you suggest for quickly
choosing the entire list?



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Select multipler folders?

"GS" wrote:

I decided to add a routine to my collection that just lists subfolder
paths under a parent folder in a userform. You're welcome to check it
out...

https://app.box.com/s/23yqum8auvzx17h04u4f


Hi Gary. There is a slight problem with your example above.

Have you tried repeatedly selecting "on and off" one of the
same items in the listbox? If you click on the same item
multiple times it will add that same path item to the array.

Rather than using the code in the lstFldrs_Change() method,
wouldn't it be better just to write a loop that steps through
each item, check if it's selected, and then add it to the array?



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
How do I create Folders/Sub folders from User Form control button Brian Excel Programming 3 February 23rd 10 09:52 PM
Links Between Folders Kathryn Gies Excel Worksheet Functions 4 May 19th 09 02:22 AM
List folders but not sub folders kaiser Excel Programming 2 July 19th 07 11:14 AM
how do i use vba to zip folders? scouse1 Excel Programming 1 June 14th 06 11:12 PM
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? Subteam Excel Discussion (Misc queries) 2 May 7th 06 08:14 PM


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