Last active
October 10, 2022 17:52
-
-
Save kouichi-c-nakamura/6ef091111a2beb480c2c817eb6410d38 to your computer and use it in GitHub Desktop.
Taken from this site https://www.extendoffice.com/documents/excel/4321-excel-activate-hyperlinks.html with a modification (`xTitleId` had to be declared in advance). Copy this into a Module in VBA editor. Make a selection of a range on a spreadsheet. And then press F5.
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
Sub activateHyperlinks() | |
'Updateby Extendoffice | |
Dim Rng As Range | |
Dim WorkRng As Range | |
On Error Resume Next | |
Dim xTitleId As String | |
xTitleId = "Website" '<-----change this as needed | |
Set WorkRng = Application.Selection | |
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8) | |
For Each Rng In WorkRng | |
Application.ActiveSheet.Hyperlinks.Add Rng, Rng.Value | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment