@m00lie,
Well, you may try to use Cells.InsertRange() to insert your desired range of cells for your needs. Similarly you may try to use Cells.DeleteRange() to remove your desired range of cells accordingly. The range/cell area can involve a single cell or multiple cells. See the sample code segments for your reference:
e.g
Sample code:
-
......
Cells sourceCells = workbook.Worksheets[0].Cells;
//Define cell area, e.g B2 where to insert the range of cell(s).
CellArea ca = new CellArea();
ca.StartRow = 1;
ca.EndRow = 1;
ca.StartColumn = 1;
ca.EndColumn = 1;
//Insert a single cell.
sourceCells.InsertRange(ca, 1, ShiftType.Down, true);
............
-
…
Workbook document = new Workbook(strFileName);
Worksheet w = document.Worksheets[“Sheet2”];
//Delete the range, i.e., B2:G6 and shifts the cells upwards.
w.Cells.DeleteRange(1, 1, 5, 6, ShiftType.Up);
…
Hope, this helps a bit.