Hi all,
As part of a bigger macro, I'm adding code that will delete rows of data if the value in column O is 0 and I can't seem to get it to function correctly. Data in column O is a dummy variable that's been created based on data in other columns and is posted as a value, rather than formula. I'm not getting any errors when I run the macro, however the cells with 0 value in column O do not get deleted.
The code that I'm using for the deletion is as follows:
Am I not seeing something that's causing it not to work properly?
As part of a bigger macro, I'm adding code that will delete rows of data if the value in column O is 0 and I can't seem to get it to function correctly. Data in column O is a dummy variable that's been created based on data in other columns and is posted as a value, rather than formula. I'm not getting any errors when I run the macro, however the cells with 0 value in column O do not get deleted.
The code that I'm using for the deletion is as follows:
VBA Code:
For w = Range("C" & Rows.Count).End(xlUp).Row to 7 Step -1
If Range("O7" & w).Value = "0" Then
Rows(w).EntireRow.Delete
End If
Next w
Am I not seeing something that's causing it not to work properly?