The following code isn't extracting URLs past the "#"
The setup
URL1/2 in A1/2 then command/control + k to set hyperlink
example
A1 = URL1 = http://stackoverflow.com/hello
A2 = URL2 = http://stackoverflow.com/hello#world
Using VBA code below
=URL(A1) = Result = http://stackoverflow.com/hello (DESIRED)
=URL(A2) = Result = http://stackoverflow.com/hello (NOT DESIRED)
Desired:
A2 = http://stackoverflow.com/hello#world
Question
- Is there a way to modify the code below to include the entire URL even after #.
VBA code
Function URL(Hyperlink As Range)
URL = Hyperlink.Hyperlinks(1).Address
End Function