Hi,
i need code to add hyperlink to a range, says D4:D53, to refer to sheet 4 to sheet 53.
Note: sheets name will change but i want the link to always refer to sheet 4 to sheet 53. i.e. valid links irregards to sheets names.
Thanks!
Sub InsertHyperlinks()
Application.ScreenUpdating = False
Dim ws As Worksheet, shtName As String, nrow As Long, i As Integer
nrow = 0
For i = 4 To ActiveWorkbook.Sheets.Count
Set ws = ActiveWorkbook.Sheets(i)
nrow = nrow + 1
With ws
shtName = ws.Name
With Sheets("INVOICE SUMMARY")
.Range("D" & nrow).Hyperlinks.Add _
Anchor:=Sheets("INVOICE SUMMARY").Range("D" & nrow), Address:="#'" & _
shtName & "'!A1", TextToDisplay:=shtName
End With
End With
Next i
End Sub