that works if you change:irow = Range("N22").end(xlup).rowtoirow = Range("N23").end(xlup).rowIf you don't make that change, then you will copy only the firstline (row 2) when there is data in row 22.