Excel Interop C# copyRange without shifting -
i'm trying copy columns (with formulas , formats) in excel document 1 zone another. code below thing when open document see new columns pasted (old columns supposed rewritten shifted right). problem needed paste these columns on existing places without shifting
int lastcol = 15; string cc1 = colnumtoletters(lastcol - 3); string cc2 = colnumtoletters(lastcol); string ci1 = colnumtoletters(lastcol + 1); string ci2 = colnumtoletters(lastcol + 4); excel.range copyrange = sheetpsd.range[cc1 + ":" + cc2]; excel.range insertrange = sheetpsd.range[ci1 + ":" + ci2]; insertrange.insert(copyrange.copy());
insertrange.pastespecial(copyrange.copy());
Comments
Post a Comment