Results 1 to 3 of 3

HYPERLINK ADDRESSINT - With or Range question...

This is a discussion on HYPERLINK ADDRESSINT - With or Range question... within the Excel Questions forums, part of the Question Forums category; I manually recorded a hyperlink macro and then modification it to work as seen No. 1 below. I tried to ...

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    1,689

    Default HYPERLINK ADDRESSINT - With or Range question...

    I manually recorded a hyperlink macro and then modification it to work as seen No. 1 below.

    I tried to modify it to work with "With" (as seen in No. 2) but it keeps putting the address in A1?

    With is better the 1 or 2?

    1. Range("A4").Select
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
    "'https://wwwxxxxxxxxxxxxxxxxxx", _
    TextToDisplay:="LRS Web Site (address is https://wwwxxxxxxxxxxxxxxxxxxxxxxx)"

    2. With .[A4]
    ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:= _
    "'https://wwwxxxxxxxxxxxxxxxxxxxxxx", _
    TextToDisplay:="LRS Web Site (address is https://wwwxxxxxxxxxxxxxxxxxxxx)"
    End With

  2. #2
    MrExcel MVP TommyGun's Avatar
    Join Date
    Dec 2002
    Location
    Clear Lake, TX
    Posts
    4,202

    Default Re: HYPERLINK ADDRESSINT - With or Range question...

    Problem is the ANCHOR...it is set to "Selection" in both cases. Try this without using the With...

    ActiveSheet.Hyperlinks.Add Anchor:=.[A4], Address:= _
    "'https://xxxxxxxxxxxxxxxxxxxxxxxxxxxx", _
    TextToDisplay:="LRS Web Site (address is https://xxxxxxxxxxxxxxxxxxxx)"


    Edited per Tommy's request ~ Von Pookie

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Posts
    1,689

    Default Re: HYPERLINK ADDRESSINT - With or Range question...

    TommyGun - worked perfectly and please see PM...

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com