Excel with c#: Exculde first rows when copying a r

2019-08-01 03:29发布

The following command copied the complete used range into the clipboard:

                mySheet.UsedRange.Copy();

I want to just exculde the first row and copy the rest into clip board. Please help

标签: c# .net excel
1条回答
仙女界的扛把子
2楼-- · 2019-08-01 04:12

You could try to get it with something like this:

Excel.Range dataWithoutFirstRow = mySheet.Range[mySheet.UsedRange.Cells[2, 1],
      mySheet.UsedRange.SpecialCells(Excel.XlCellType.xlCellTypeLastCell)];
查看更多
登录 后发表回答