Graham182

New Member
Joined
Jan 31, 2010
Messages
31
Hi I have the Macro below that will search throught a directory and list the .Xls in it. What I am now trying to do with this is to create a hyperlink from the results that will take me right to the spreadsheet?

Is there anything i can easily put in Thanks to anyone that can help :)

Sub Dirlist()
Dim i As Long
With Application.FileSearch
.NewSearch
' *** Change Folder name to suit ***
.LookIn = "C:\MyDocuments"
.SearchSubFolders = True

Dir (Folder & "\" & Extension)
.Filename = "*.xls*"
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Cells(i, 1).Value = Right(.FoundFiles(i), InStr(StrReverse(.FoundFiles(i)), "\") - 1)
Next

End If
End With
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
It seem to have the feel of what i want but because i'm doing this at my work place i can't install anything new.
If its possible just to add something to the original macro?
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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
Back
Top