Steve
Sub DeleteStrike()
Range("A1").Activate
Do Until ActiveCell.Value = ""
If ActiveCell.Font.Strikethrough = True Then
ActiveCell.EntireRow.Delete
Else: ActiveCell.Offset(1, 0).Activate
End If
Loop
End Sub
Change the starting Range to wherever your data starts.
But the bad news is that .findnext() doesn't remember the .findformat stuff.
But the good news is that you can just do another find--but after the previous
foundcell--just like your own version of .findnext().
Option Explicit
Sub DeleteStikeouts()
Dim myRng As Range
Dim DelRng As Range
Dim FoundCell As Range
Dim FirstAddress As String
Dim wks As Worksheet
Set wks = ActiveSheet
With wks
Set myRng = .Range("a1:a25")
End With
With Application.FindFormat.Font
.Strikethrough = True
.Superscript = False
.Subscript = False
End With
With myRng
Set FoundCell = .Cells.Find(what:="", _
after:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
lookat:=xlPart, _
searchorder:=xlByRows, _
searchdirection:=xlNext, _
MatchCase:=False, _
searchformat:=True)
If FoundCell Is Nothing Then
MsgBox "None found"
Else
FirstAddress = FoundCell.Address
Set DelRng = FoundCell
Do
Set FoundCell = .Cells.Find(what:="", _
after:=FoundCell, _
LookIn:=xlValues, _
lookat:=xlPart, _
searchorder:=xlByRows, _
searchdirection:=xlNext, _
MatchCase:=False, _
searchformat:=True)
If FoundCell.Address = FirstAddress Then
Exit Do
Else
Set DelRng = Union(DelRng, FoundCell)
End If
Loop
If DelRng Is Nothing Then
'this shouldn't happen
Else
DelRng.EntireRow.Select '.Delete 'when you're sure it worked
End If
End If
End With
End Sub
I used .select so you could verify that it was working--change it to .delete
when you're ready to test it out.
--
Dave Peterson
Sub DeleteStrikethrough()
For i = 1 to 25
If Cells(i, "a").Font.Strikethrough Then Rows(i).Delete
Next i
End Sub
--
Don Guillett
SalesAid Software
dguil...@austin.rr.com
"Steve" <St...@discussions.microsoft.com> wrote in message
news:EA5EE5F9-5995-4AB2...@microsoft.com...
"Steve" <St...@discussions.microsoft.com>
wrote in message
Steve