Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts

Tuesday, October 11, 2011

Excel Removing or adding hyperlinks

Useful code to remove and add hyperlinks in Excel using VB
Public Sub Convert_To_Hyperlinks()
    Dim Cell As Range
    For Each Cell In Intersect(Selection, ActiveSheet.UsedRange)
        If Cell <> "" Then
            ActiveSheet.Hyperlinks.Add Cell, Cell.Value
        End If
    Next
End Sub
Sub RemoveHyperlinks()

'Remove all hyperlinks from the active sheet
ActiveSheet.Hyperlinks.Delete

End Sub