Public Sub IdentifyDeletionRows()
Dim i As Long
For i = 4 To Range("A" & Rows.Count).End(xlUp).Row Step 4
Range("B" & i).Value = "Do not delete"
Next i
End Sub
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Inserted Modulo" = Table.AddColumn(Source, "Modulo", each Number.Mod([Column1], 4), type number),
#"Filtered Rows" = Table.SelectRows(#"Inserted Modulo", each ([Modulo] = 3)),
#"Removed Columns" = Table.RemoveColumns(#"Filtered Rows",{"Modulo"})
in
#"Removed Columns"
Etb, see my post which is a VBA solution. You can also use a formula and auto-filter to achieve this.Ok, can it be done without query
Option Explicit
Sub InsertFour()
Dim lr As Long, x As Integer
lr = Range("A" & Rows.Count).End(xlUp).Row
Dim i As Long
x = 0
For i = 2 To lr
If x = 4 Then x = 0
Range("K" & i) = x + 1
x = x + 1
Next i
End Sub
Option Explicit
Sub del_rows()
Dim i%
Dim MY_RG As Range
For i = 4 To Cells(Rows.Count, 1).End(3).Row
If i Mod 4 <> 0 Then
If MY_RG Is Nothing Then
Set MY_RG = Range("a" & i)
Else
Set MY_RG = Union(MY_RG, Range("a" & i))
End If
End If
Next
MY_RG.EntireRow.Delete
End Sub
Sub del_rows()
Dim i As Long
Dim MY_RG As Range
For i = 6 To Cells(Rows.Count, 1).End(3).Row
If i Mod 6 <> 0 Then
If MY_RG Is Nothing Then
Set MY_RG = Range("a" & i)
Else
Set MY_RG = Union(MY_RG, Range("a" & i))
End If
End If
Next
MY_RG.EntireRow.Delete
End Sub