This project has moved. For the latest updates, please go here.

Copy and insert rows

Sep 13, 2012 at 8:37 PM

Hi

How can i copy a set or range from one workbook and insert the same in another workbook

     xRange = srcxWS.get_Range("A5:R" + rowIndex1.ToString());
     xRange.Copy(Type.Missing);

	int rowIndex2 = 5;
        xRange1 = ((Microsoft.Office.Interop.Excel.Range)destxWS.Cells[rowIndex2, 1]);
        xRange1.Insert(Type.Missing,Type.Missing);

This is what we do in the excel interop so how can we achieve this functionality of copying a range and then inserting it in another workbook

 

Regards

Raghu

Coordinator
Sep 14, 2012 at 4:14 PM

ws2.Cell("A1").Value = ws1.Range("A1:D4");