I have hyperlinked pdf drawings to drawing numbers detailed in cells. However the hyperlink will not work as it goes to another location, different to the one I had specified. I have seen multiple sites with people discussing this. Here is my code, but I don't think it is a code issue. I have around 2000 drawings so manually hyperlinking is something I really do not want to do.
Any help you could provide would much appreciated.
Sub CreateHyperLinker()
Dim ws As Worksheet
Dim x As Long
Dim strFile As String
Dim strPath As String
Set ws = ThisWorkbook.Sheets("Full List")
Sheets("Full List").Range("D2") = ws.Name
strPath = "C:\Users\SS7U6170\Desktop\Atlantic drawings\0 General"
Sheets("Full List").Range("D3") = strPath
With ws
x = 22
Sheets("Full List").Range("D4").Value = x
rng = 3
Sheets("Full List").Range("D5").Value = rng
For c = rng To x
Sheets("Full List").Cells(c, 5).Value = c
aa = c
Sheets("Full List").Cells(c, 6).Value = aa
bb = "a" & aa
Sheets("Full List").Cells(c, 7) = bb
dd = "b" & aa
Sheets("Full List").Cells(c, 8).Value = dd
xx = ws.Range(bb)
Sheets("Full List").Cells(c, 9).Value = xx
ee = ws.Range(dd)
Sheets("Full List").Cells(c, 10).Value = ee
Range(bb).Activate
Sheets("Full List").Cells(c, 11).Value = Range(bb).Activate
cc = "713" + "-" + Left(xx, 3) + "-" + Mid(xx, 5, 2) + "-" + Right(xx, 3) + "_" + ee + ".PDF"
Sheets("Full List").Cells(c, 12).Value = cc
strFile = cc
Sheets("Full List").Cells(c, 13).Value = strFile
strFile = Dir(strPath & strFile)
Sheets("Full List").Cells(c, 14).Value = strFile
If strFile = Dir(strPath & strFile) Then _
Sheets("Full List").Cells(c, 1).Hyperlinks.Add Sheets("Full List").Cells(c, 1), strFile
Next
End With
End Sub
Any help you could provide would much appreciated.
Sub CreateHyperLinker()
Dim ws As Worksheet
Dim x As Long
Dim strFile As String
Dim strPath As String
Set ws = ThisWorkbook.Sheets("Full List")
Sheets("Full List").Range("D2") = ws.Name
strPath = "C:\Users\SS7U6170\Desktop\Atlantic drawings\0 General"
Sheets("Full List").Range("D3") = strPath
With ws
x = 22
Sheets("Full List").Range("D4").Value = x
rng = 3
Sheets("Full List").Range("D5").Value = rng
For c = rng To x
Sheets("Full List").Cells(c, 5).Value = c
aa = c
Sheets("Full List").Cells(c, 6).Value = aa
bb = "a" & aa
Sheets("Full List").Cells(c, 7) = bb
dd = "b" & aa
Sheets("Full List").Cells(c, 8).Value = dd
xx = ws.Range(bb)
Sheets("Full List").Cells(c, 9).Value = xx
ee = ws.Range(dd)
Sheets("Full List").Cells(c, 10).Value = ee
Range(bb).Activate
Sheets("Full List").Cells(c, 11).Value = Range(bb).Activate
cc = "713" + "-" + Left(xx, 3) + "-" + Mid(xx, 5, 2) + "-" + Right(xx, 3) + "_" + ee + ".PDF"
Sheets("Full List").Cells(c, 12).Value = cc
strFile = cc
Sheets("Full List").Cells(c, 13).Value = strFile
strFile = Dir(strPath & strFile)
Sheets("Full List").Cells(c, 14).Value = strFile
If strFile = Dir(strPath & strFile) Then _
Sheets("Full List").Cells(c, 1).Hyperlinks.Add Sheets("Full List").Cells(c, 1), strFile
Next
End With
End Sub