首页 > 其他 > 详细

VSTO 获取sheet单元格行列数

时间:2015-01-22 15:14:32      阅读:485      评论:0      收藏:0      [点我收藏+]
 1     Public Sub Igor()
 2         Dim Dtsheet As Excel.Worksheet
 3         Dim TotalC As Long             原始数据范围列
 4         Dim TotalR As Long             原始数据范围行
 5         Dtsheet = Globals.ThisWorkbook.Sheets("sheet1")
 6         TotalC = Dtsheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Column
 7         TotalR = Dtsheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row
 8         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)
 9 
10     End Sub

 

VSTO 获取sheet单元格行列数

原文:http://www.cnblogs.com/igor/p/4241561.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!