PDA

View Full Version : Extract URL with the hashtag #



dj44
03-30-2018, 06:23 AM
Now good Friday all,

I had some hyperlinks in my excel cells

Now the below works




Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next




It fails to work correctly on the ones that have this # sign in them


rg/TR/2018/REC-201413567028/infrastructure.html#tested-0

And I do need the complete hyperlink

I cant think why this isssue

How may I extract the complete url

I had an alternative idea may be some maipulation but im still thinking:think:

Charlize
03-30-2018, 11:09 AM
Try HL.Name instead of HL.Address
other possibilities ...

MsgBox HL.TextToDisplay
MsgBox HL.Address
MsgBox HL.Name

Charlize

dj44
03-31-2018, 04:01 AM
Thank you Charlize,

thats given me some more ideas
let me do some testing