结构体必须放在“模块”中:

Type Org
    tag As String
    person As New Collection
End Type

使用:

Sub testType()
    Dim x As Org
    x.tag = "ft"

    x.person.Add ("A")
    x.person.Add ("B")

    Debug.Print ("name = " & x.tag)
    Debug.Print ("count = " & x.person.count)
    For i = 1 To x.person.count
        Debug.Print (x.person.Item(i))
    Next
End Sub

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2022-12-23
  • 2021-11-23
  • 2021-06-19
  • 2022-12-23
猜你喜欢
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-02
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案