The best I could come up with was:
Sub Macro1()
__ Cells.Hyperlinks.Delete
End Sub
I tried to modify this to look for only "mailto:" links:
Sub Macro2()
Dim h as Integer
__ For h = 1 to Hyperlinks.Count
__ __ If Left(Hyperlinks(h).Address,7) = "mailto:" Then Hyperlinks(h).Delete
__ Next h
End Sub
I got a subscript out of range Error and it wouldn't remove all of the hyperlinks – looked like it was deleting (h-1) of them…
Jeff Molby on March 31, 2009 at 12:45 pm
You might just have to change it to " For h = 0 to Hyperlinks.Count – 1 "
If that doesn't fix it, send me some examples of typical cells, so I can get an idea of what kind of data this is being run against.
Several different ways to strip text… depends on how everything's laid out. Email me some sort of example and I can help you script something.
The best I could come up with was:
Sub Macro1()
__ Cells.Hyperlinks.Delete
End Sub
I tried to modify this to look for only "mailto:" links:
Sub Macro2()
Dim h as Integer
__ For h = 1 to Hyperlinks.Count
__ __ If Left(Hyperlinks(h).Address,7) = "mailto:" Then Hyperlinks(h).Delete
__ Next h
End Sub
I got a subscript out of range Error and it wouldn't remove all of the hyperlinks – looked like it was deleting (h-1) of them…
You might just have to change it to " For h = 0 to Hyperlinks.Count – 1 "
If that doesn't fix it, send me some examples of typical cells, so I can get an idea of what kind of data this is being run against.