close

Is there a way to create a macro that will search a section of a worksheet
and delete rows that have a zero in the leading cell?

Thanks in advance!

Sub DeleteRowswithZeroInColumnA()
Dim lastrow as Long, i as Long
lastrow = cells(rows.count,1).End(xlup).Row
for i = lastrow to 2 step -1
if cells(i,1).Value = 0 then
rows(i).Delete
end if
Next
End Sub

--
Regards,
Tom Ogilvyquot;pywhacketquot; wrote:

gt; Is there a way to create a macro that will search a section of a worksheet
gt; and delete rows that have a zero in the leading cell?
gt;
gt; Thanks in advance!

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()