Last active
March 18, 2024 14:23
-
-
Save cemerson/4bf26ccf67386a5c17b036984e9ad635 to your computer and use it in GitHub Desktop.
AutoHotkey/Excel: Extract Hyperlinks from Selected Cells
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
;; Excel AutoHotkey Script: Extract Hyperlinks from Selected Cells | cemerson 3/18/24 | |
;; Press 'Control+q' to activate. | |
;; Note: Must be on same machine that Excel is running on - doesn't work over RDP/VNC. | |
;; Helpful References: | |
;; https://www.autohotkey.com/board/topic/150159-extracting-hyperlinks-from-excel-cells-using-com/ | |
;; https://www.youtube.com/watch?v=p5TNM8koMfw | |
^q:: | |
try XL:=ComObjActive("Excel.Application") | |
linkcount = 0 | |
links = "" | |
for c in XL.range(XL.Selection.Address).Hyperlinks{ | |
links.= c.Address "`n" | |
linkcount ++ | |
} | |
MsgBox % linkcount " links found and copied to the clipboard." | |
Clipboard = % links ; send ^{c} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment