Hi All, thanks again!
This code has issues! It was working until I expanded the conditions to add the AND and then expanded the copy range with the E:M.
Also, I want to reduce the number of rows looked at in my "lastrow" to use the one I have deactivated, which counts column h.
Any help appreciated.
ws.Activate
'lastrow = ws.Range("a1:a" & Range("h" & Rows.Count).End(xlUp).Row)
lastrow = ws.Range("a" & Rows.Count).End(xlUp).Row
'input data
For i = 2 To lastrow
If ws.Range("a" & i).Value <> "" and_
ws.Range("i" & i).Value <> "0.00" then
ws.Range("A" & i & ":C" & i & ",E" &i&":m" &i).copy
SOP.Activate
lastrowrpt = SOP.Range("a" & Rows.Count).End(xlUp).Row
b = SOP.Cells(Rows.Count, 1).End(xlUp).Row
SOP.Range("a" & lastrowrpt + 1).Select
ActiveSheet.Paste
End If
Next i
This code has issues! It was working until I expanded the conditions to add the AND and then expanded the copy range with the E:M.
Also, I want to reduce the number of rows looked at in my "lastrow" to use the one I have deactivated, which counts column h.
Any help appreciated.
ws.Activate
'lastrow = ws.Range("a1:a" & Range("h" & Rows.Count).End(xlUp).Row)
lastrow = ws.Range("a" & Rows.Count).End(xlUp).Row
'input data
For i = 2 To lastrow
If ws.Range("a" & i).Value <> "" and_
ws.Range("i" & i).Value <> "0.00" then
ws.Range("A" & i & ":C" & i & ",E" &i&":m" &i).copy
SOP.Activate
lastrowrpt = SOP.Range("a" & Rows.Count).End(xlUp).Row
b = SOP.Cells(Rows.Count, 1).End(xlUp).Row
SOP.Range("a" & lastrowrpt + 1).Select
ActiveSheet.Paste
End If
Next i