Consulting

Results 1 to 5 of 5

Thread: How to make Hyperlink which will change with cell number?

  1. #1

    How to make Hyperlink which will change with cell number?

    Hello to all!
    There is one cell on Excel sheet witch has Hyperlink on itself (yes! on itself, beciouse I need handpoint as mouse Iconabove this cell). But user can add or del some cells above this cell. Becouse of this Hyperlink doesn't follow this cell number:
    For example If my cell has Hyperlink on "C25" and then user Add two rows, it has Hyperlink on "C25" not on "C27", but I need Hyperlink on "C27"

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try adding an Excel Defined name to that cell, and then change the link in the hyperlink to the Defined Name rather than the cell reference.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Yes this is good, But I have a lot of such cells (they may be add or del )and I dn't want to add name to each of the cell

  4. #4
    Hello to all again!
    I solve this problem, and post my solution here:

    [VBA]
    Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    Application.ScreenUpdating = False
    ActiveSheet.Hyperlinks.Add Anchor:=Range(Target.Range.Address), Address:="", SubAddress:=Target.Range.Address, ScreenTip:="Hi!
    Range(Target.Range.Address).Select
    Application.ScreenUpdating = True
    End Sub
    [/VBA]

    Thats all! NowHyperlink is always connect with one cell and link with it, and not depends of count of cells in above and left of this cell

  5. #5
    VBAX Newbie
    Joined
    Jun 2010
    Posts
    2
    Location

    How to use your solution?

    Dear jiura,

    Can you please explain how to use your solution. I am not an expert in macros so please go easy on me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •