循環我有一個集合是這樣的:改變原有的集合,而在VBA
Dim BrokerCol as New Collection
'Added some data to the Collection
BrokerCol .Add temp_broker, BROKER_NAME
而且我通過收集這樣的循環:
For Each collectionitem In BrokerCol
If ((collectionitem.Bid - bid_average)/bid_average) < pThresholdValue Then
'Want to change something here in BrokerCol instead of Collection Item
Else
Next collectionitem
至於說,上面我想改變BrokerCol中的某些內容而不是更改收集項目。我怎麼做?
我嘗試這樣做:
BrokerCol.Item(CollectionItem).Bid = 1
它給了我一個 '類型不匹配' 錯誤。不知道如何解決這個問題。
什麼是temp_broker?一個東西?您是否嘗試過使用'collectionitem.bid = 1'這是與集合中相同的對象。 –
@TimWilliams可以添加你的評論作爲答案 – lakesh