vba - excel vba - 创建一个包含数组条目的集合
问题描述
有没有办法用数组的条目创建集合?
我有一个包含三个条目的数组:
dim components(1 to 3)
components(1) = "A"
components(2) = "B"
components(3) = "C"
现在我想遍历数组并为每个组件创建一个集合:
for each c in components
dim c as new collection
next
但这会引发错误。
谢谢
解决方案
如果您需要多个集合,请创建集合集合。您不能将多个集合压缩到变量“c”中。
for each c in components
*add new subcollection to a main collection*
next
推荐阅读
- scala - 至少对于获取的批量数据,Spark-sql Pivoting 无法按预期工作
- azure - 为什么在为 Azure SQL 创建文件 DSN 时看不到我的数据库?
- rest - Artifactory REST API:如何有效地为用户获取权限目标
- java - 下面的代码每两秒打印一次静态系统时间,但我想每两秒打印一次动态系统时间
- android - React Native VLCPlayer RTSP 延迟(安卓版)
- python - 跨多个线程使用 Pika 通道
- python - 打印一个字符串,同时记录符号 % 之后的所有组件
- css - 如何在同一个容器中将标题居中对齐,文本左对齐?
- python - 加权页面排名图表示
- c# - SignedCms.decode() 在 c# 中做了什么