0
votes

I am trying to adapt the code within the link below.

I need it to, within my first sheet, when a hyperlink is clicked in column F (which links through to a second sheet "Pricing"), the value of the corresponding cell in column A is printed in column C of the Pricing sheet.

Examples:

  • In the first sheet, hyperlink in F6 directs to Pricing worksheet
  • When clicking the hyperlink, cell value A6 in the first sheet prints in cell C6 of the Pricing worksheet.

https://www.techonthenet.com/excel/hyperlinks/update_cell2013.php

The code is based on a flat value, I need it to work dynamically on each row:

If Sh.Name = "First Sheet" Then
    If GSourceCell = "F6" Then
        Sheets("Pricing").Range("C6").Value = Sheets("First Sheet").Range("A6")
1
Can you explain further? I'm not understanding it from the documentation. I need all parts of it to be dynamic, except C6 in the pricing sheet where the cell value is pulled through.OJ88

1 Answers

0
votes

I hope this helps:

If Sh.Name = "First Sheet" Then
If GSourceCell = "F" & ActiveCell.Row Then
Sheets("Pricing").Range("C & ActiveCell.Row").Value = Sheets("First Sheet").Range("A" & ActiveCell.Row)