You can try this on a copy of your workbook.
Sub AAAAA()
Dim i As Long, j As Long, ii As Long, a As Long, lr As Long, lc As Long
'This assumes that the last used column can be determined from the top row.
lc = Cells(1, Columns.Count).End(xlToLeft).Column
Application.ScreenUpdating = False
For j = 1 To lc
lr = Cells(Rows.Count, j).End(xlUp).Row
For i = 1 To lr - 10
If WorksheetFunction.CountIf(Range(Cells(i, j), Cells(i + 9, j)), Cells(i, j).Value) >= 10 Then
ii = i
a = 0
Do
If Cells(ii, j).Value = 0 Then a = a + 1: ii = ii + 1
Loop Until Cells(ii, j).Value <> 0
Range(Cells(i, j), Cells(i + a - 1, j)).Delete Shift:=xlUp
End If
Next i
Next j
Application.ScreenUpdating = True
End Sub
Bookmarks