Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create Folders/Sub folders from User Form control button | Excel Programming | |||
Links Between Folders | Excel Worksheet Functions | |||
List folders but not sub folders | Excel Programming | |||
how do i use vba to zip folders? | Excel Programming | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) |