View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Keith Keith is offline
external usenet poster
 
Posts: 262
Default Excel: Code to delete entire rows when font is Strikethrough?

Hello OssieMac,

Thanks for the quick response,

The entire row is not formatted as strike through, only columns A to M.
Could we just base it on Column A?


"OssieMac" wrote:

Hi Keith,

Are the entire rows formatted to strikethrough? If so then the following
code should do what you want. If not the entire row formatted to
strikethrouth then will need to know the specific columns that are.

Note: It is necessary to work backwards from the bottom when deleting rows.

Sub DeleteStrikeThrough()
Dim rngRow As Range
Dim r As Long

For r = Sheets("Sheet1").UsedRange.Rows.Count To 1 Step -1
If Rows(r).Font.Strikethrough = True Then
Rows(r).Delete
End If
Next r

End Sub


--
Regards,

OssieMac


"Keith" wrote:

I have a spreadsheet where some rows are formatted with strikethrough font.
I need some code to delete the entire row where the font is set to strike
through.

Thanks,

Keith