dynamic hyperlink

leecavturbo

Well-known Member
Joined
Jan 4, 2008
Messages
681
well when i say dynamic. I have a hyperlink ( link ? ) in sheet 2 to a cell in sheet 1. but what i need is when i copy that sheet to make another ( with tab, copy move to end ) is for the link to reference sheet 1 but 1 row lower than the last.
possible without vba ?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try, this will help:
Insert Module and copy paste the code. Select sell exm. Sheet1 B2 . Also in each Tab write the formula to send back to Main Tab "Summary"

Sub CreateLinksToAllSheets()
Dim sh As Worksheet
Dim cell As Range
For Each sh In ActiveWorkbook.Worksheets
If ActiveSheet.Name <> sh.Name Then
ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'" & sh.Name & "'" & "!A1", TextToDisplay:=sh.Name
ActiveCell.Offset(1, 0).Select
End If
Next sh
End Sub
 

Attachments

  • Untitled.png
    Untitled.png
    30.6 KB · Views: 7
  • Untitled1.png
    Untitled1.png
    56.2 KB · Views: 7
Upvote 0
This should work even if you change your file name:
Excel Formula:
=HYPERLINK(MID(CELL("filename",A1),FIND("[",CELL("filename",A1)),FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))+1)&"Sheet1!$A"&SHEET(),"My Link")
Note: "filename" stays as it is. Do not replace it with your file name.
 
Upvote 1
Like this?
Excel Formula:
=HYPERLINK(MID(CELL("filename",A1),FIND("[",CELL("filename",A1)),FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))+1)&"Sheet1!$A"&2+SHEET(),"My Link")
You have to adjust number 2 according to your sheet name. So if your sheets start from 1, then 2+1 will be 3. If your sheets start from 2 you must write 1+SHEET()
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,812
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top