Excel Ninja In Training
New Member
- Joined
- May 6, 2011
- Messages
- 25
I have a long column with three kinds of cells: some are empty, some have hyperlinks, some have no hyperlinks.
I want to clear out the ones with no hyperlinks.
My idea is something like this:
Sub ClearCellsWithoutHyperlinks()
Dim i As Integer
For i = 1 To Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Rows.Count
If IsEmpty(ActiveCell.Hyperlink) Then
Selection.ClearContents
End If
ActiveCell.Offset(1, 0).Select
Next i
End Sub
Of course, the line
If IsEmpty(ActiveCell.Hyperlink) Then
is just something I made up. It's not real VBA.
Is there something that would work here?
I want to clear out the ones with no hyperlinks.
My idea is something like this:
Sub ClearCellsWithoutHyperlinks()
Dim i As Integer
For i = 1 To Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Rows.Count
If IsEmpty(ActiveCell.Hyperlink) Then
Selection.ClearContents
End If
ActiveCell.Offset(1, 0).Select
Next i
End Sub
Of course, the line
If IsEmpty(ActiveCell.Hyperlink) Then
is just something I made up. It's not real VBA.
Is there something that would work here?