jaynorman46

New Member
Joined
Apr 5, 2011
Messages
23
Hi,

I have over 15,000 files on a file share. I am looking to try and extract the path for each individual one and paste it in a long list on a sheet with its associated folder. I'm having a hard time of where to start. the most difficult part is there are thousands of folders and different types of files as well. I have 35 master folders with sub folders within.



My eventual goal is to create an easy to access index on an excel sheet. Once I have all the Paths I can create Hyperlinks to the exact file for one click viewing.


Is this even possible?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Maybe a start?

Code:
Sub ListFiles2()
Dim MyFolder As String
Dim MyFile As String
Dim j As Integer
With Application.FileDialog(msoFileDialogFolderPicker)
    .AllowMultiSelect = False
    .Show
    MyFolder = .SelectedItems(1)
End With
MyFile = Dir(MyFolder & "\*.xls")
Do While MyFile <> ""
    j = j + 1
    Cells(j, 1).Value = MyFile
    MyFile = Dir
Loop
End Sub
 

jaynorman46

New Member
Joined
Apr 5, 2011
Messages
23
Thanks for replying!

just for clarification I need to give myfolder a value? and can I do this with .pdf and .jpg?
 

jaynorman46

New Member
Joined
Apr 5, 2011
Messages
23
Ok, I see what the program you wrote does now. I dont want to be prompted for each folder. I have 1,463 folders to do this with is there anyway that this step could be automatic?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
You could create a list of folders on a sheet then loop through those values.

There is no 'magic' solution as far as I know.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,233
Messages
5,768,947
Members
425,507
Latest member
AndreaWorkPlace

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top