Create and Remove Hyperlinks (from VBA)

Often you have to create and remove hyperlinks at run time.
Just paste the following code in a general module:
Sub Create() Call CreateHyperlink(Sheet1.Range("A1:A10")) End Sub Sub Delete() Call RemoveHyperlink(Sheet1.Range("A1:A10")) End Sub Sub CreateHyperlink(rng As Range) Dim rngCell As Range For Each rngCell In rng rngCell.Hyperlinks.Add rngCell, "", , "Screen_Tip", rngCell.Value Next rngCell End Sub Sub RemoveHyperlink(rng As Range) rng.Hyperlinks.Delete End Sub
»
- Vishesh's blog
- Add new comment
- 2086 reads

Recent comments
2 hours 12 min ago
13 hours 34 min ago
1 day 3 hours ago
1 day 2 hours ago
1 day 5 hours ago
1 day 16 hours ago
1 day 19 hours ago
1 day 19 hours ago
2 days 1 hour ago
2 days 2 hours ago