jamesbyrne
New Member
- Joined
- Mar 12, 2010
- Messages
- 5
Hi,
I am trying to create a macro to change cells in the final colum in all worksheets whith a sum formula if they already contain a numerical entry. The formula will sum from column c to the second last column (left adjacent) in the same row.
Here is where I'm at so far which I'm thinking is a fair bit off. Any help is greatly appreciated.
I am trying to create a macro to change cells in the final colum in all worksheets whith a sum formula if they already contain a numerical entry. The formula will sum from column c to the second last column (left adjacent) in the same row.
Here is where I'm at so far which I'm thinking is a fair bit off. Any help is greatly appreciated.
Code:
Sub delete_rows()
Dim rw As Long, i As Long
rw = Cells(Rows.Count, 1).End(xlUp).Row
For i = rw To 9 Step -1
If Application.Sum(Cells(i, 3).Resize(1, 7)) = 0 Then
Rows(i).Delete
End If
Next
End Sub