excel所有数据行数

liangf215 2007-10-14 07:58:24
vba 怎么得到excel中的数据行数?
sheet中会出现整行都为空的数据
...全文
91 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xthand 2007-10-15
  • 打赏
  • 举报
回复
Public Function GetLastrow(ByRef pSheet As Worksheet) As Integer
Const CheckColumn As Integer = 26
Dim i As Integer
Dim intInitial As Integer
Dim intLastrow As Integer
For i = 1 To CheckColumn
intInitial = pSheet.Cells(65536, i).End(xlUp).Row
If intInitial > intLastrow Then intLastrow = intInitial
Next
GetLastrow = intLastrow
End Function
kris2010 2007-10-15
  • 打赏
  • 举报
回复
那只能用循环了
liangf215 2007-10-15
  • 打赏
  • 举报
回复
不会这么麻烦吧,应该有简单的方法

5,139

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 Office开发/ VBA
社区管理员
  • Office开发/ VBA社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧