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
- 19112 reads
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago