在我的工作簿中,我有一个宏来隐藏工作表上的所有对象。
一直有效到今天。
Sub Hiding()
Dim sObject As Object
Dim a As Integer, v As Integer
'Count all visible Worksheets
v = 0
For Each s In ActiveWorkbook.Worksheets
If s.Visible = True Then
v = v + 1
End If
Next s
'Hide all Objects
For a = 2 To v
For Each sObject In Worksheets(a).Shapes
sObject.Visible = False
Next
Next
End Sub
我也尝试过Dim sObject As Shape
答案 0 :(得分:1)
使用v = v + 1循环创建的Visible Worksheets.Count应该是可见工作表序数索引的数组,而不是可见工作表的总数。当您遍历a时,a应该检索数组中的值,而不仅仅是 1、2,3 等工作表索引号。
db.countries.aggregate([
{ "$addFields": { "country": { "$objectToArray": "$countryMap" } } },
{ "$unwind" : "$country" },
{ "$unwind" : "$country.v" },
{ "$project": {"_id":"$country.v._id","Name":"$country.v.Name" ,"populateRate":"$country.v.populateRate",
} },
{ "$sort" : { "Name" : -1 } },
{"$skip": 0 },
{"$limit": 25 }
]);