Hi all,
I have this file with in Q and R amounts. Whenever there is amount in both that is not equal to 0 i want to copy the line and insert below.
Therefor i use this script:
Dim cell As Variant
Set Rng = Range("P2", Range("P20000").End(xlUp))
For Each cell In Rng
cell.Select
If cell.Offset(0, 1).Value <> 0 And cell.Offset(0, 2).Value <> 0 Then
Selection.EntireRow.Copy
Selection.EntireRow.Insert
CutCopyMode = False
cell.Offset(2, 0).Select
Else
cell.Offset(1, 0).Select
End If
Next
It skips the ones that does not match the statement correctly. However, once it found an item that results in a TRUE it keeps repeating to copy and inserting the same item over and over again. Can someone see whats wrong with my code?
Bookmarks