Sub countrownum() Dim i, num, rownum num = Worksheets.Count For i = 2 To num ‘Worksheets(i).Select rownum = WorksheetFunction.CountA(Worksheets(i).Columns("a:a")) Sheets(1).Cells(i, 5) = rownum Next End Sub
时间: 2024-11-02 11:06:31
Sub countrownum() Dim i, num, rownum num = Worksheets.Count For i = 2 To num ‘Worksheets(i).Select rownum = WorksheetFunction.CountA(Worksheets(i).Columns("a:a")) Sheets(1).Cells(i, 5) = rownum Next End Sub