大马资讯论坛 - 马来西亚中文资讯平台
标题:
C# Excel 删除指定行 Excel delete row
[打印本页]
作者:
资讯王
时间:
2010-12-22 16:40
标题:
C# Excel 删除指定行 Excel delete row
C# Excel 删除指定行 Excel delete row
ws = worksheet
删除一行 To delete a single row this way:
Excel.Range ran;
ran = (Excel.Range)this.Application.Rows[12, missing];
ran.Select();
ran.Delete(Microsoft.Office.Interop.Excel.XlDirection.xlUp);
复制代码
同时连续删除多行To delete multiple rows:
//Get a set of cells in the rows
Excel.Range rng = ws.get_Range("a12", "A14");
//Then act on the entire rows of the range
rng.EntireRow.Delete(Excel.XlDirection.xlUp);
复制代码
欢迎光临 大马资讯论坛 - 马来西亚中文资讯平台 (http://freeinfo.com.my/)
Powered by Discuz! X3.3