VBA统计excel数据表数量 Sub sheetcount() Dim num As Integer num = ThisWorkbook.Sheets.Count MsgBox "工作表数量" & num End Sub 统计excel数据表数量并将数据表名目放在当前代码所在的表单中 Sub a() For Each sh In Sheets k = k + 1 Cells(k, 1) = sh.Name Next End Sub