如何统计excel中的sheet数量

ALT+F11 组合键调出 VBA编辑器 

左边工程确认当前工作薄的名称,然后  插入--模块

复制以下代码进去,最后按F5 运行


Sub sheetcount()

Dim num As Integer

num = ThisWorkbook.Sheets.Count

MsgBox "该工作薄含有 " & num & " 个工作表"

End Sub

参考链接:http://zhidao.baidu.com/question/117442892.html

猜你喜欢

转载自blog.csdn.net/wn_hello/article/details/51130850