Consulting

Results 1 to 8 of 8

Thread: Solved: How to get a URL address from the cell value

  1. #1

    Unhappy Solved: How to get a URL address from the cell value

    Cell A3 VALUE = 4422259
    Cell A3 Link = http://cm-web.systems.uk./E!/Report/...spx?id=4422259

    in a4 i want to show the link address as above how can i get that using vba ? or excel ?


    thanks in advance for look at this post

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    With Range("A3")

    .Offset(1, 0).Value = .Hyperlinks(1).Address
    End With
    [/vba]
    ____________________________________________
    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
    Knowledge Base Approver VBAX Master Oorang's Avatar
    Joined
    Jan 2007
    Posts
    1,135
    Location
    [VBA]Sub GetHyperLink()
    Dim rng As Excel.Range
    Dim hlk As Excel.Hyperlink
    Dim strMsg As String
    Set rng = Excel.Selection
    For Each hlk In rng.Hyperlinks
    strMsg = strMsg & (hlk.Range.Address & vbTab & hlk.Address & vbLf)
    Next
    MsgBox strMsg
    End Sub[/VBA]
    Cordially,
    Aaron



    Keep Our Board Clean!
    • Please Mark your thread "Solved" if you get an acceptable response (under thread tools).
    • Enclose your code in VBA tags then it will be formatted as per the VBIDE to improve readability.

  4. #4

    Hyperlink

    With Range("A3") .Offset(1, 0).Value = .Hyperlinks(1).Address End With
    this changes a3 to the addres. I want to show the address in a4 and not change anything for a3 can you help

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    With Range("A4")

    .Offset(-1, 0).Value = .Hyperlinks(1).Address
    End With
    [/vba]
    ____________________________________________
    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

  6. #6

    Need further help

    With Range("J2:J" & lastrow)
    .Offset(-8, 0).Value = .Hyperlinks(1).Address
    End With
    this doesnt work...

    how can i change the .OFFSET(-8,0) TO $A2

  7. #7
    VBAX Master
    Joined
    Jul 2006
    Location
    Belgium
    Posts
    1,286
    Location
    [VBA]Sub adresses()
    Dim myrange As Range
    For Each myrange In Range("J1:J" & lastrow)
    With myrange
    .Offset(0, -9).Value = .Hyperlinks(1).Address
    End With
    Next myrange
    End Sub[/VBA]Charlize

  8. #8

    thanks

    worked great

Posting Permissions

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