I'm not sure what you are asking, but that sounds a lot like a UDT (user-defined type) or a UDT within a UDT
Should you need to resize the array later:Code:Private Type StudentStruct Name As String TestScore As Integer End Type Private Type SchoolStruct Count As Long ' how many StudentStruct in UDT StudentData() As StudentStruct ' collection of StudentStruct's End Type Dim mySchool As SchoolStruct Private Sub Command1_Click() ReDim mySchool.StudentData(0 to 1) mySchool.Count = 2 With mySchool .StudentData(0).Name = "Hans" .StudentData(0).TestScore = 88 .StudentData(1).Name = "LaVolpe" .StudentData(1).TestScore = 110 ' ;) End With Dim i As Integer For I = 0 To mySchool.Count - 1 MsgBox mySchool.StudentData(i).Name & " scored " & mySchool.StudentData(i).TestScore Next End Sub
Something like that or something else? If something else you might want to describe it a bit better.Code:mySchool.Count = mySchool.Count + 1 ReDim Preserve mySchool.StudentData(0 To mySchool.Count -1)




Reply With Quote