0
votes

I have an excel sheet with hyperlinks and text

For example: HYPERLINK (Want to Keep!) Retail Price: $46.99 (Want to Delete) Our Price: $39.99 (Want to Delete)

I would like some vba code that keeps all the hyperlinks and deletes all the text and numbers.

I've been searching all over and can only find vba code that deletes hyperlinks and keeps the text :(

1
Do you have any code that you have tried to put together?Juan Carlos Farah

1 Answers

0
votes

Try this extremely small macro:

Sub hyperfinder()
    Dim r As Range
    For Each r In ActiveSheet.UsedRange
        If r.Hyperlinks.Count = 0 Then
            r.Clear
        End If
    Next r
End Sub