Writting a Hyperlink Formula with Macros

Andlopezgo

New Member
Joined
Mar 30, 2020
Messages
4
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hello there, I have a simple Hyperlink formula:

=HYPERLINK("#Index!A7","Link")

How can I make the sheet name and the cell dynamic?.

Something like:

Sheets("Summary").Cells(lastrow + 1, 8).Value = "=HYPERLINK(""#ActiveWorkbook.Worksheets(i).Name ! ActiveWorkbook.Worksheets(I).Cells(j, 1).Value"",""Link"")"

Thanks in advance for the help.

BR

AL
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You need to concatenate in the dynamic parts - something like this maybe.

VBA Code:
Sheets("Summary").Cells(lastrow + 1, 8).Value = "=HYPERLINK(""#'" & ActiveWorkbook.Worksheets(I).Name & "'!" & ActiveWorkbook.Worksheets(I).Cells(J, 1).Address & """,""Link"")"
 
Upvote 0
You need to concatenate in the dynamic parts - something like this maybe.

VBA Code:
Sheets("Summary").Cells(lastrow + 1, 8).Value = "=HYPERLINK(""#'" & ActiveWorkbook.Worksheets(I).Name & "'!" & ActiveWorkbook.Worksheets(I).Cells(J, 1).Address & """,""Link"")"
Hey FormR, Thank you so much for your help. It is working just fine.

Have a great of the day.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,128
Members
453,021
Latest member
Justyna P

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