Add Hyperlinks to cells on other sheets same workbook.

realniceguy5000

Board Regular
Joined
Aug 19, 2008
Messages
148
Hi, Could someone advise what is wrong with this script below? All I'm looking to do is link the cell on sheets(1) to the cell on sheets(5) so when a user clicks the cell they go right to sheets(5) and the correct cell.

Thank You, Mike

Code:
A = Sheets(1).Range("D65000").End(xlUp).Address
mynum = Sheets(1).Range("D65000").End(xlUp).Value + 1
 
B = Sheets(5).Range("A65000").End(xlUp).Offset(49, 0).Address
Range(B).Value = mynum
 
Sheets(1).Select
Range(A).Offset(1, 0).Select
 
tolink = Sheets(5).Range(B).Address
fromlink = Sheets(1).Range(A).Offset(1, 0).Address
 
With Worksheets(1)
  .Hyperlinks.Add Anchor:=.Range(fromlink), Address:="", SubAddress:=tolink, TextToDisplay:=mynum
End With
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,224,598
Messages
6,179,818
Members
452,946
Latest member
JoseDavid

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