View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Glenn Glenn is offline
external usenet poster
 
Posts: 8
Default Loop through columns and then rows

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.