The code you posted seems to serve only to move the address of range 'End Row' down by 1 row.
For example if the named range 'End Row' was initially located on row 17 then your code performs the following steps
1 Copy to clipboard range (A16:S16)
2 Inset new row at range (A17:L17) and move existing cells down
3 Paste clipboard (ie data from range A16:S16) to range (A17:S17)
4 Clear range (A17:L17)
5 Activate cell (A17)
The net effect is:
1 The data on row 16 is unchanged
2 You now have an empty row on row 17
3 The named range 'End Row' is now on row 18.
This could be all achieved a little more simply. It looks like your 'copy' and 'paste' steps are redundant. You immediately clear what you copied.The only other comment I would make is change all instances of 'ActiveSheet' to refer specifically to the sheet in question. ie
Worksheets("Sheet1").Range(Cells(n - 1, 1), Cells(n - 1, 19)).Copy
instead of
ActiveSheet.Range(Cells(n - 1, 1), Cells(n - 1, 19)).Copy
Making a call to 'ActiveSheet' can cause confusion if for whatever reason the 'active sheet' ceases to be the 'active sheet'. This is something like making an 'unqualified call'. VBA does not specifically know which 'instance' of a sheet is now the 'active sheet'.
All I can think of.
2024 RRS on the road
2011 D4 3.0 in the drive way
1999 D2 V8, in heaven
1984 RRC, in hell
Bookmarks