VBA中的结构体
结构体必须放在“模块”中:
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