Hi,
I have the following code that creates hyperlinks automatically to bring user to cells on another sheet. However, I will like to reference a range of cells instead of just a single cell.
This is the solution that I have thought of. But the reference is not valid. Would appreciate if anyone can jump in to help me with the syntax:
I have the following code that creates hyperlinks automatically to bring user to cells on another sheet. However, I will like to reference a range of cells instead of just a single cell.
VBA Code:
Sub GoToAnotherCellInAnotherSheetInTheSameWorkbook()
Dim i_counter As Integer
Dim i_output As Integer
i_output = 14
For i_counter = 16 To 20
ActiveSheet.Hyperlinks.Add Range("F" + CStr(i_counter)), Address:="", SubAddress:="'" & Sheet7.Name & "'!D" & CStr(i_output), TextToDisplay:="Go"
i_output = i_output + 132
Next i_counter
End Sub
This is the solution that I have thought of. But the reference is not valid. Would appreciate if anyone can jump in to help me with the syntax:
VBA Code:
Sub GoToAnotherCellInAnotherSheetInTheSameWorkbook()
Dim i_counter As Integer
Dim i_output1 As Integer
Dim i_output2 As Integer
i_output1 = 14
i_output2 = 42
For i_counter = 16 To 20
ActiveSheet.Hyperlinks.Add Range("F" + CStr(i_counter)), Address:="", SubAddress:="'" & Sheet7.Name & "'!A & CStr(i_output1): A & CStr (i_output2)", TextToDisplay:="Go"
i_output1 = i_output1 + 132
i_output2 = i_output2 + 132
Next i_counter
End Sub
Last edited by a moderator: