Hyperlink Macro
Solved/Closed
SLKG
SLKG
- Posts
- 6
- Registration date
- Friday April 16, 2010
- Status
- Member
- Last seen
- April 27, 2010
SLKG
- Posts
- 6
- Registration date
- Friday April 16, 2010
- Status
- Member
- Last seen
- April 27, 2010
Related:
- Hyperlink Macro
- Macro to copy data from one sheet to another based on criteria ✓ - Forum - Excel
- Macro copy and paste in next blank cell - Guide
- Macro to create new sheet and copy data - Forum - Excel
- Run macro automatically when cell value changes ✓ - Forum - Excel
- How to copy from wikipedia without hyperlinks - How-To - Office Software
1 reply
rizvisa1
Apr 18, 2010 at 08:43 AM
- Posts
- 4479
- Registration date
- Thursday January 28, 2010
- Status
- Contributor
- Last seen
- May 5, 2022
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