I have a repetitive task were I have to combine dat from multiple sheets and check for duplicates. and som other stuff
So the sheet (sheet2, generated thru othe vba scripts,but until there all works ) looks something like this
Then I have a short vba loop
But this only deletes some rows ?? so my result look like this after running the code
Running it again, again some lines are deleted, but not all that contain value 0 in colomn B ?
Seems simple, what am I missing (I'm VBA newby)
PS Short other question, How do I address the #N/A in the list? Once the above is ok it should delete all rows that don't contain #N/A
So the sheet (sheet2, generated thru othe vba scripts,but until there all works ) looks something like this
Then I have a short vba loop
VBA Code:
Sub Delete()
Sheets("Sheet2").Select
Range("a1").Select
lr2 = Cells.Find("*", Cells(1, 1), xlFormulas, xlPart, xlByRows, xlPrevious, False).Row
Dim cell As Range
For Each cell In Range("b2:b" & lr2)
If cell.Value = "0" Then
cell.EntireRow.Delete
End If
Next cell
End Sub
But this only deletes some rows ?? so my result look like this after running the code
Running it again, again some lines are deleted, but not all that contain value 0 in colomn B ?
Seems simple, what am I missing (I'm VBA newby)
PS Short other question, How do I address the #N/A in the list? Once the above is ok it should delete all rows that don't contain #N/A