I've a single workbook, with two sheets. In Sheet1, I've a link in each row, that would link to Sheet2. In Sheet2, I need to generate a link that would take me back to the same row I clicked on the link. The number of that row is stored in cell A1 of Sheet2 once I click on the link.
For instance, this formula would generate a link that would bring me back to sheet 1, cell 1. However, I want to be able to generate a different row number and not the first row all the time.
Sheet2.Cells(19, 1) = "=HYPERLINK(""#Sheet1!A1"",""CLICK HERE"")"
Thanks.
Sheet2!A1, you don't need VBA for this. Just define a named range, make the named range refer to=INDIRECT("Sheet1!A" & Sheet2!A1), and put that named range as the hyperlink target.