Created
September 2, 2020 11:26
-
-
Save spjeff/3bc836e46c57f9422e9ca592d8ecbb22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' from https://howtouseexcel.net/how-to-extract-a-url-from-a-hyperlink-on-excel | |
Function GetURL(cell As range, _ | |
Optional default_value As Variant) | |
'Lists the Hyperlink Address for a Given Cell | |
'If cell does not contain a hyperlink, return default_value | |
If (cell.range("A1").Hyperlinks.Count <> 1) Then | |
GetURL = default_value | |
Else | |
GetURL = cell.range("A1").Hyperlinks(1).Address & "#" & cell.range("A1").Hyperlinks(1).SubAddress | |
End If | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment