Hyperlink Macro
Solved/Closed
SLKG
Posts
6
Registration date
Friday 16 April 2010
Status
Member
Last seen
27 April 2010
-
17 Apr 2010 à 23:47
SLKG Posts 6 Registration date Friday 16 April 2010 Status Member Last seen 27 April 2010 - 18 Apr 2010 à 15:53
SLKG Posts 6 Registration date Friday 16 April 2010 Status Member Last seen 27 April 2010 - 18 Apr 2010 à 15:53
Related:
- Hyperlink Macro
- Hyperlink in gmail app - Guide
- How to remove hyperlink in word - Guide
- Excel hyperlink to another sheet - Guide
- Excel online macro - Guide
- Excel run macro on open - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday 28 January 2010
Status
Contributor
Last seen
5 May 2022
766
18 Apr 2010 à 08:43
18 Apr 2010 à 08:43
Presuming this is related to your previous question. This function is based on same. The file name is assumed to be like 700002.pdf
However you can also add the hyper link when data is copied ( as in your previous question). If you want to go with that, the highlighted lines are all you need to add to the previous code
However you can also add the hyper link when data is copied ( as in your previous question). If you want to go with that, the highlighted lines are all you need to add to the previous code
Sub putHyperLink()
Dim PI_Sheet As String
Dim DC_Sheet As String
Dim invoiceLoc As Long
Dim invoice As Variant
Dim sFileLoc As String
PI_Sheet = "Product Invoice"
DC_Sheet = "Data Collection"
sFileLoc = "C:\Users\haadi\Documents\"
Sheets(DC_Sheet).Select
invoice = Sheets(PI_Sheet).Range("M7")
invoiceLoc = 0
On Error Resume Next
invoiceLoc = Application.WorksheetFunction.Match(invoice, Range("A:A"), 0)
On Error GoTo 0
If (invoiceLoc > 0) Then
Sheets(DC_Sheet).Hyperlinks.Add _
Anchor:=Sheets(DC_Sheet).Range("A" & invoiceLoc & ":A" & (invoiceLoc + 10)), _
Address:="""" & sFileLoc & invoice & ".pdf""", _
TextToDisplay:="""" & invoice & """"
End If
End Sub
18 Apr 2010 à 15:53
SLK