Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try the following macro: ---- Sub FindFiles() Dim myPath As String Dim lLen As Long, i As Long myPath = "D:\temp" 'change to your needs With Application.FileSearch .NewSearch .LookIn = myPath .SearchSubFolders = True .filename = "*.*" .FileType = msoFileTypeExcelWorkbooks If .Execute() 0 Then For i = 1 To .FoundFiles.Count Cells(i, 1) = .FoundFiles(i) Cells(i, 2).FormulaR1C1 = "=Hyperlink(R[0]C[-1])" Next i Else MsgBox "There were no files found." End If End With End Sub --- this will insert the filename in column A and the hyperlink in column B -- Regards Frank Kabel Frankfurt, Germany James wrote: Hi I am not sure if it is poosible, but I'll try to explain. Is there a way in xl2002,vba to list all the files in a foleder & its subfolders in a tree sort of format so that its shows names of the file (not the whole location) Hyperlinked. When user clicks on it it opens up the files. Thanks for your help -James |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Hyperlink PDF Files | Excel Discussion (Misc queries) | |||
hyperlink to files? | Excel Discussion (Misc queries) | |||
Look up actual files from a list in excel and enter as a hyperlink | Excel Discussion (Misc queries) | |||
hyperlink to jpg files | Excel Discussion (Misc queries) | |||
adding Tiff files to the list of image files | Excel Programming |