OK now I need to detect when the data in any 2 adjacent cells in columns B and C are both equal to zero, and then delete that row.
For example, below I would want to have row 35 deleted.
Excel 2010 32 bit
<tbody>
[TD="align: center"]29[/TD]
[TD="align: center"]1:53:30[/TD]
[TD="align: center"]113.50[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]1:54:00[/TD]
[TD="align: center"]114.00[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]1:54:30[/TD]
[TD="align: center"]114.50[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]1:55:00[/TD]
[TD="align: center"]115.00[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]1:55:30[/TD]
[TD="align: center"]115.50[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]1:56:00[/TD]
[TD="align: center"]116.00[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]0:00:00[/TD]
[TD="align: center"]0.00[/TD]
[TD="align: center"]1324.000[/TD]
</tbody>
I already have a macro that deletes rows but don't know how to add to it:
Sub CommandButton1_Click()
With Columns(77)
On Error Resume Next
.SpecialCells(xlFormulas, xlLogical).EntireRow.Delete
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
On Error GoTo 0
End With
End Sub
For example, below I would want to have row 35 deleted.
Excel 2010 32 bit
B | C | D | |
---|---|---|---|
<tbody>
[TD="align: center"]29[/TD]
[TD="align: center"]1:53:30[/TD]
[TD="align: center"]113.50[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]1:54:00[/TD]
[TD="align: center"]114.00[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]31[/TD]
[TD="align: center"]1:54:30[/TD]
[TD="align: center"]114.50[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]32[/TD]
[TD="align: center"]1:55:00[/TD]
[TD="align: center"]115.00[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]33[/TD]
[TD="align: center"]1:55:30[/TD]
[TD="align: center"]115.50[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]34[/TD]
[TD="align: center"]1:56:00[/TD]
[TD="align: center"]116.00[/TD]
[TD="align: center"]0.500[/TD]
[TD="align: center"]35[/TD]
[TD="align: center"]0:00:00[/TD]
[TD="align: center"]0.00[/TD]
[TD="align: center"]1324.000[/TD]
</tbody>
I already have a macro that deletes rows but don't know how to add to it:
Sub CommandButton1_Click()
With Columns(77)
On Error Resume Next
.SpecialCells(xlFormulas, xlLogical).EntireRow.Delete
.SpecialCells(xlFormulas, xlErrors).EntireRow.Delete
On Error GoTo 0
End With
End Sub
Last edited: