Hyperlink Macro
Solved/Closed
SLKG
Posts
6
Registration date
Friday April 16, 2010
Status
Member
Last seen
April 27, 2010
-
Apr 17, 2010 at 11:47 PM
SLKG Posts 6 Registration date Friday April 16, 2010 Status Member Last seen April 27, 2010 - Apr 18, 2010 at 03:53 PM
SLKG Posts 6 Registration date Friday April 16, 2010 Status Member Last seen April 27, 2010 - Apr 18, 2010 at 03:53 PM
Related:
- Hyperlink Macro
- Hyperlink in gmail - Guide
- Spell number in excel without macro - Guide
- Remove hyperlink in word - Guide
- Macro excel download - Download - Spreadsheets
- Excel macro to create new sheet based on value in cells - Guide
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Apr 18, 2010 at 08:43 AM
Apr 18, 2010 at 08:43 AM
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
Apr 18, 2010 at 03:53 PM
SLK