updating hyperlink

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.
 
N

Nigel

You could name the cell (range) and refer to that. Names references are
updated as rows/columns are added and removed.
 
N

Nasir.Munir

Thanks Nigel. Do I have to name all the cells for that purpose? is
there any way of doing that through some code?
 
D

David McRitchie

Since you want the hyperlink for the same cell as referenced in the
formula you could use the HYPERLINK Worksheet Function.
-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top