Very new to VBA but have experience in some other languages but need help with this one. I'm trying to create a macro that deletes every 4 rows. For example leave row 1 but delete 2,3,4,5 skip 6 and continue on. This is what I have so far:
Sub Macro1()
For x = 100 To 1 Step -2
Range(x & ":" & x).Select
Selection.ClearContents
Next x
End Sub
I'm not sure if my For loop is missing something or maybe i need some sort of index counter to tell it to delete four at a time.
This will start at row 100 and step backwards to row 1.
(I have the![enter image description here](https://i.stack.imgur.com/GmoTp.gif)
.Select
in this .gif just to show you visually. You don't want that in the actual macro as it can slow it down):Edit: Ah, I noticed I delete the row. You can just replace
.EntireRow.Delete
with.EntireRow.ClearContents
and it'll just clear the contents without deleting the row itself.