Glenn
Even though the route I took deleted all hyperlinks in the worksheet, it
would be infinitely quicker and easier on the eye than the 'Selecting' done
with your code. It is seldom necessary to select anything to act on it and
indeed it needs two statements, 'select and activecell', etc.
Not that this will be the most efficient code for sure, but this will find
the last column used and the last row used and delete hyperlinks in that
range only. (XL97 and up only)
Sub TestRangeAndDelHyperlinks()
Dim iLastCol As Integer, lLastRow As Long
iLastCol = Range("IV1").End(xlToLeft).Column
lLastRow = Range("A65536").End(xlUp).Row
Range(Cells(1, 1), Cells(lLastRow, iLastCol)).Hyperlinks.Delete
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS
"Glenn" wrote in message
ups.com...
Actually, your macro doesn't need a preselected range in order to work,
provided that the criteria for limiting your action -- that is, a blank
column or row to indicate end of iteration -- works throughout your
data range.
If, as you menitoned, you're trying to remove hyperlinks from a range
of cells to the right and below any cell you select, the code could be
written like this:
Sub Remove_Hyperlinks()
Do Until ActiveCell.Value = ""
Start = ActiveCell.Address
Do Until ActiveCell.Value = ""
ActiveCell.Hyperlinks.Delete
ActiveCell.Offset(0, 1).Select
Loop
Range(Start).Select
ActiveCell.Offset(1, 0).Select
Loop
End Sub
Nick's last solution is best if, in fact, you're trying to remove ALL
hyperlinks from the worksheet.