HYPERLINK ADDRESSINT - With or Range question...

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: HYPERLINK ADDRESSINT - With or Range question...

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    1,739
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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,739
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

      
    TommyGun - worked perfectly and please see PM...

User Tag List

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