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
- Login or register to post comments
- 19157 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago