Answers for "vba excel delete every other row"

VBA
0

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
Posted by: Guest on February-02-2021
0

excel delete ever other vba

Sub Delete_Every_Third_Row()
Dim Rng As Range
Set Rng = Application.InputBox("Select the Range (Excluding headers)", "Range Selection", Type:=8)
For i = Rng.Rows.Count To 1 Step -3
If i Mod 3 = 0 Then
Rng.Rows(i).Delete
End If
Next i
End Sub
Posted by: Guest on February-02-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language