logo
  • 教程列表
  • SO官方文档
  • 集合
    • 获取集合的项目计数
    • 确定集合中是否存在密钥或项目
    • 将项添加到集合中
    • 从集合中删除项目
    • 从集合中检索项目
    • 清除集合中的所有项目
  1. StackOverflow 文档
  2. VBA 教程
  3. 集合
  4. 获取集合的项目计数

获取集合的项目计数

Created: November-22, 2018

通过调用 .Count 函数可以获得 Collection 中的项目数:

句法:

.Count()

样品用法:

Public Sub Example()
    Dim foo As New Collection
    
    With foo
        .Add "One"
        .Add "Two"
        .Add "Three"
        .Add "Four"
    End With
     
    Debug.Print foo.Count   'Prints 4
End Sub
  • 确定集合中是否存在密钥或项目
  • 集合

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明