• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA Code required to add hyperlink on cell value with respective sheet in same workbook.

Amit Chhabra

New Member
Please refer the attached file as input to provide the solution.

I need VBA code to create hyperlink for cell value available in I:I (Project Sheet) to the respective sheets available in same workbook.

Thanks in advance.

Regards,
Amit Chhabra
 

Attachments

  • Dummy File.xlsx
    10.7 KB · Views: 4
Code:
Sub Linker()

Dim rng As Range
Dim subrng As Range
Dim lstrow As String

With Worksheets("Project")
    lstrow = .Cells(Rows.Count, "I").End(xlUp).Row
    Set rng = .Range("I3:I" & lstrow)
    For Each subrng In rng
        .Hyperlinks.Add Anchor:=subrng, Address:="", SubAddress:=subrng.Value & "!A1", TextToDisplay:=subrng.Value
    Next subrng
End With

End Sub
 
Sir, Can we know the code which work in a folder base worksheets.
Like Sheet1 of worksheet1 have all names in range A3:A30
It should be linked with files of same name in same folder where original worksheet1 exist
 
Back
Top