以下代码供参考,可以在不同的sheet之间操作
复制粘贴
- int from = int.Parse(textBox1.Text)-1;
- int to = int.Parse(textBox2.Text)-1;
- fpSpread1.Sheets[0].ClipboardCopy(new CellRange(from, 0, 1, 5));
- fpSpread1.Sheets[0].AddSelection(to, 0, 1, 5);
- fpSpread1.Sheets[0].ClipboardPaste();
复制代码
剪切粘贴,
- int from = int.Parse(textBox1.Text)-1;
- int to = int.Parse(textBox2.Text)-1;
- fpSpread1.Sheets[0].AddSelection(from, 0, 1, 5);
- fpSpread1.Sheets[0].ClipboardCut();
- fpSpread1.Sheets[0].AddSelection(to, 0, 1, 5);
- fpSpread1.Sheets[0].ClipboardPaste();
复制代码 |