VSTO 获取sheet单元格行列数

     Public Sub Igor()
Dim Dtsheet As Excel.Worksheet
Dim TotalC As Long '原始数据范围列
Dim TotalR As Long '原始数据范围行
Dtsheet = Globals.ThisWorkbook.Sheets("sheet1")
TotalC = Dtsheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Column
TotalR = Dtsheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row
Dtsheet.Range("A1", Dtsheet.Cells(TotalR, TotalC)).Replace(What:="", Replacement:="N/A", LookAt:=Excel.XlLookAt.xlWhole, SearchOrder:=Excel.XlSearchOrder.xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False) End Sub
上一篇:(转)Yale CAS + .net Client 实现 SSO(2)


下一篇:xml语法规则