updating hyperlink

  • Thread starter Thread starter Nasir.Munir
  • Start date Start date
N

Nasir.Munir

I have a worksheet which uses a function to get value from a different
cell.

=if (SheetName! CellName <> "",SheetName! CellName, "") ----syntax
=if(Log!A5<>"",Log!A5,"")----actual code snippet

I have then hyperlinked the cell to the same cell from where it is
getting the value ie A5.
Problem: Whenever I insert rows, the reference gets updated but I have
to manually adjust the hyperlink to A6 say(row is added before A5).
Is there a way of adjusting that through VBA?
It would be awesome if I could get some help here, as I have to update
the hyperlinks for more than thousand places.

Thanks,
Nasir.
 
You could name the cell (range) and refer to that. Names references are
updated as rows/columns are added and removed.
 
Thanks Nigel. Do I have to name all the cells for that purpose? is
there any way of doing that through some code?
 
Since you want the hyperlink for the same cell as referenced in the
formula you could use the HYPERLINK Worksheet Function.
-
 
Back
Top