excel vba delete every other row in table code example
Example 1: vba excel delete every other row
Sub Delete_Even()
Application.ScreenUpdating = False
lr = Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
If lr Mod 2 = 0 Then
Else
lr = lr - 1
End If
For i = lr To 1 Step -2
Rows(i & ":" & i).Delete Shift:=xlUp
Next i
Application.ScreenUpdating = True
End Sub
Example 2: excel vba delete rows
ThisWorkbook.Worksheets(1).Rows(3).EntireRow.Delete
ThisWorkbook.Worksheets("Feuil1").Rows(3).Cells.ClearContents
Range("My_RANGE").Rows(3).EntireRow.Delete