Web queries produce hyperlinks in Excel
When my code loads an html file, I have it break the links. This is
what I use:
' --------------------------
Sub NukeHyperLinks()
''' Kills hyperlinks in the worksheet, but keeps them blue and
underlined
Dim hypo As Hyperlink, hypoaddress As String
For Each hypo In ActiveSheet.Cells.Hyperlinks
Debug.Print hypo.Address, hypo.name, hypo.Parent.Address
hypoaddress = hypo.Parent.Address
hypo.Delete
With Range(hypoaddress).Font
.ColorIndex = 41
''' 5: Blue, 41: Faded Blue, 13: Purple
.Underline = True
End With
Next
Set hypo = Nothing
End Sub
' --------------------------
HTH,
- Jon
_______
Quote:
> I've written web queries to pull down htm files from a web site and
> many of the data elements become hyperlinks on my spreadsheet. I want
> only the text or values, not hyperlinks to go back to the web? What am
> I doing wrong? Excel97 SR2 Windows95 TIA
> --
> Ctrl-Alt-Dlt-Hlp ?)?
> Sent via Deja.com http://www.deja.com/
> Before you buy.