注意两者的区别:
遍历sheets
1 Sub 遍历sheets下的所有对象()2 For Each shs In Sheets3 k = k + 14 Cells(k, 1) = shs.Name5 Next6 End Sub
遍历worksheets
1 Sub 遍历worksheets下的所能对象()2 For Each shs In Worksheets3 k = k + 14 Cells(k, 2) = shs.Name5 Next6 End Sub
本文共 301 字,大约阅读时间需要 1 分钟。
注意两者的区别:
遍历sheets
1 Sub 遍历sheets下的所有对象()2 For Each shs In Sheets3 k = k + 14 Cells(k, 1) = shs.Name5 Next6 End Sub
遍历worksheets
1 Sub 遍历worksheets下的所能对象()2 For Each shs In Worksheets3 k = k + 14 Cells(k, 2) = shs.Name5 Next6 End Sub
转载于:https://www.cnblogs.com/gongyanxu/p/8420870.html