PDA

View Full Version : Solved: How to get a URL address from the cell value



khalid79m
05-27-2008, 09:40 AM
Cell A3 VALUE = 4422259
Cell A3 Link = http://cm-web.systems.uk./E!/Report/FrameSet.aspx?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

Bob Phillips
05-27-2008, 09:56 AM
With Range("A3")

.Offset(1, 0).Value = .Hyperlinks(1).Address
End With

Oorang
05-27-2008, 09:56 AM
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

khalid79m
05-29-2008, 09:57 AM
:dunno


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

Bob Phillips
05-29-2008, 10:12 AM
With Range("A4")

.Offset(-1, 0).Value = .Hyperlinks(1).Address
End With

khalid79m
06-03-2008, 03:53 AM
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

Charlize
06-03-2008, 04:19 AM
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 SubCharlize

khalid79m
06-26-2008, 09:37 AM
worked great :)