View Poll Results: Was this tip helpful

Voters
2. You may not vote on this poll
  • Yes

    2 100.00%
  • No

    0 0%
Results 1 to 1 of 1

Thread: Changing Hyperlink To Another Sheet By Changing Value Of Cell

  1. #1
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10

    Lightbulb Changing Hyperlink To Another Sheet By Changing Value Of Cell

    If you wish to change the hyperlink of a cell based on the address given within that cell, the following code will automatically update the hyperlink provided within that cell.

    Code can be revised for any cell/range though I have used A1 as an example. Check the attachment for a working sample

    Code:
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    
        If Target.Address(0, 0) = "A1" Then
            Target.Hyperlinks.Delete
            ActiveSheet.Hyperlinks.Add Anchor:=Target.Cells(1), Address:="", SubAddress:=Target.Value, TextToDisplay:=Target.Value
        End If
        
    End Sub
    Attached Files Attached Files
    Last edited by Excel Fox; 06-04-2011 at 03:27 PM.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

Similar Threads

  1. Changing Slideshow viewing mode to kiosk using vba
    By Times in forum Powerpoint Help
    Replies: 1
    Last Post: 05-10-2013, 12:37 AM
  2. Replies: 1
    Last Post: 02-10-2013, 06:21 PM
  3. Replies: 1
    Last Post: 01-27-2013, 08:21 PM
  4. Add Shape With Hyperlink To Another Sheet
    By Excel Fox in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 07-30-2011, 04:51 AM
  5. Replies: 0
    Last Post: 04-03-2011, 07:57 PM

Tags for this Thread

Posting Permissions

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