How do I copy rows

Mar 22, 2011 at 4:17 PM

I need to copy two rows from the top of my worksheet (5 & 6)  and insert them into rows (10 & 11).  I looked at the ExcelRange Copy but I cant get the syntax correct.

Thanks,

Glenn

Coordinator
Mar 22, 2011 at 4:55 PM
Try something like this...
ws.Cells["5:6"].Copy(ws.Cells["10:11"]);
It will overwrite row 10 & 11 so use the InsertRow before you do this if you want to keep any data below
Mar 23, 2011 at 6:58 PM
Edited Mar 23, 2011 at 6:59 PM

Thanks that worked.  Sometimes it hard to see the simple things  went you’re looking to deep.

Glenn