Trying to remove all the rows in a table and then clear the contents of cells that are the color RGB(102, 153, 255) or not formula based. Below is what I have so far
Private Sub CommandButton9_Click()
Dim tbl As ListObject
Set tbl = Worksheets("Worksheet1").ListObjects("Table1")
With tbl.DataBodyRange
If .Rows.Count > 1 Then
.Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count).Rows.Delete
End If
Application.FindFormat.Interior.Color = RGB(102, 153, 255)
Application.FindFormat.Clear
End With
tbl.DataBodyRange.Rows(1).SpecialCells(xlCellTypeConstants).ClearContents
End Sub
Private Sub CommandButton9_Click()
Dim tbl As ListObject
Set tbl = Worksheets("Worksheet1").ListObjects("Table1")
With tbl.DataBodyRange
If .Rows.Count > 1 Then
.Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count).Rows.Delete
End If
Application.FindFormat.Interior.Color = RGB(102, 153, 255)
Application.FindFormat.Clear
End With
tbl.DataBodyRange.Rows(1).SpecialCells(xlCellTypeConstants).ClearContents
End Sub