Hi most appreciate expert,
I would like to insert a hyperlink in the following code:
Could someone replace my useless line by one that works, please?! Could not figure out how to do it. Actually it is just to put in the 3rd column the hyperlink which takes the path from the 2nd and the name for the link from the first column of the same line. I don't want a direct link in the 2nd column as the file will be copied to several computers, all with a slightly different tree and by applying the replace function on column 2 everyone can adjust the hyperlinks later alone.
Using Office 2002.
Would be grateful for help.
Thx,
tass.
I would like to insert a hyperlink in the following code:
Code:
Sub metadata1()
Dim wsOut As Worksheet
Dim zOut As Long
Dim xOut As Long
Dim ws As Worksheet, WB As Workbook
Dim varFS
Dim i
Set wsOut = ThisWorkbook.Worksheets(1)
wsOut.Cells.Clear ' <--Achtung ;-)
zOut = 1
Application.ScreenUpdating = False
Set varFS = Application.FileSearch
With varFS
.LookIn = "C:\Temp\
.Filename = "*.xls"
.SearchSubFolders = True
If .Execute > 0 Then
For i = 1 To .FoundFiles.Count
Set WB = Workbooks.Open(varFS.FoundFiles(i), UpdateLinks:=0)
zOut = zOut + 1
wsOut.Cells(zOut, 1) = WB.Name
wsOut.Cells(zOut, 2) = WB.Path & "\" & WB.Name
wsOut.Cells(zOut, 3).Formula = Hyperlink(zOut, 2; zOut, 1) '<- this was my poor trial to get it done by myself (does not work)
xOut = 4
For Each ws In WB.Worksheets
wsOut.Cells(zOut, xOut) = "WS " & ws.Index & ":" & ws.Name
xOut = xOut + 1
wsOut.Cells(zOut, xOut) = Cells(1, 1) & " - " & Cells(2, 1)
xOut = xOut + 1
'usw
Next
WB.Close savechanges:=False
Next i
End If
End With 'varFS
Application.ScreenUpdating = True
End Sub
Using Office 2002.
Would be grateful for help.
Thx,
tass.