cutemeatball
New Member
- Joined
- Jun 13, 2022
- Messages
- 20
- Office Version
- 365
- Platform
- Windows
Hello! So this macro works and deletes the rows where specific columns equal 0. But the problem is that it deletes my first 4 rows which are empty spaces throughout. Can anyone assist on this?
Thanks!
Thanks!
VBA Code:
Sub delete3zerocolumns()
Dim lr As Long, i As Long
Dim ws As Worksheet
For Each ws In Worksheets
With ws
lr = .Cells(.Rows.Count, "I").End(xlUp).Row
For i = lr To 1 Step -1
If .Cells(i, "Q") = 0 And .Cells(i, "R") = 0 And .Cells(i, "S") = 0 Then
.Rows(i).Delete
End If
Next i
End With
Next ws
End Sub