worksheets 和 sheets 的不同

注意两者的区别:

 

遍历sheets

1 Sub 遍历sheets下的所有对象()
2 For Each shs In Sheets
3     k = k + 1
4     Cells(k, 1) = shs.Name
5 Next
6 End Sub

 

遍历worksheets

1 Sub 遍历worksheets下的所能对象()
2 For Each shs In Worksheets
3     k = k + 1
4     Cells(k, 2) = shs.Name
5 Next
6 End Sub

 

posted on 2018-02-06 09:43  搞笑机械师  阅读(646)  评论(0编辑  收藏  举报

导航