I\'m trying to copy an entire row by index number and paste it to another row with a different index number when a certain condition is met (I know the issue is not with the
I assume that you want to copy Rows(i)
and paste it as value in Rows(lastRow)
. So, you need to replace this line
.Rows(lastRow) = .Rows(i).Value
with these two lines:
.Rows(i).Copy
.Rows(lastRow).PasteSpecial xlPasteValues
Or
.Rows(lastRow).Copy
.Rows(i).PasteSpecial xlPasteValues
if you want to copy Rows(lastRow)
and paste it as value in Rows(i)
.
Edit:
To paste everything (formulas + values + formats), use paste type as xlPasteAll
.
Reference: msdn