In this video, I will show you various ways to delete every other row or delete every other column in Excel.
I will also cover how to delete every third/fourth/fifth row or column in Excel.
To delete alternate rows, you can use a helper column and use a formula that helps you identify alternate rows. This could be done by using the ISEVEN function that checks each row number and returns TRUE if the row is even and false if it isn't.
Once you have this, you can easily filter the rows with FALSE in the helper columns and delete these.
In case you want to delete every third row, you need to use the MOD function to identify every third row. Once you have it, you can easily filter and delete every third row or every fourth row.
I also cover a method to use a simple VBA code to delete alternate rows in Excel.
Below is that VBA CODE TO DELETE ALTERNATE ROWS:
Sub Delete_Every_Other_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 2
If i Mod 2 = 0 Then
Rng.Rows(i).Delete
End If
Next i
End Sub
When it comes to deleting alternate columns, you can not filter these. But you can sort and bring all those columns together that you want to delete.
I cover a simple method that uses the MOD function to identify alternate columns and then sort these from lefttoright to bring these together. Once you have these in one place, you can select and delete these.
And there is also a VBA code that you can use to delete alternate columns.
Below is the VBA CODE TO DELETE ALTERNATE COLUMNS
Sub Delete_Every_Other_Column()
Dim Rng As Range
Set Rng = Application.InputBox("Select the Range (Excluding headers)", "Range Selection", Type:=8)
For i = Rng.Columns.Count To 1 Step 2
If i Mod 2 = 0 Then
Rng.Columns(i).Delete
End If
Next i
End Sub
You can also read more about this method here: https://trumpexcel.com/deleteeveryo...
Free Excel Course https://trumpexcel.com/learnexcel/
Paid Online Training https://trumpexcel.com/exceltraining/
Best Excel Books: https://trumpexcel.com/bestexcelbooks/
⚙ Gear I Recommend:
Camera https://amzn.to/3bmHko7
Screen Recorder techsmith.z6rjha.net/26D9Q
USB Mic https://amzn.to/2uzhVHd
Wireless Mic: https://amzn.to/3blQ8uk
Lighting https://amzn.to/2uxOxRv
Subscribe to get awesome Excel Tips every week: https://www.youtube.com/user/trumpexc...
Note: Some of these links here are affiliate links!
#Excel #ExcelTips #ExcelTutorial