I am trying to create a list of objects in VBA but it seems like new objects are not being created and values are being updated to a single instance of a class.
This is the class
' ---------------------------------------------------------------
'
' Class to represent Program Increment
'
' ---------------------------------------------------------------
Public name As String
Public sprints As New Collection
This is the calling code:
' get the unique pi values
Dim piList As New Collection
For r = firstRow To lastRow
currentVal = Cells(r, 2)
On Error Resume Next
Dim currentPi As New ProgramIncrement
currentPi.name = currentVal
piList.Add currentPi, currentVal
On Error GoTo 0
Next
This is the output for the first pi

And this is the output for the second pi

I'm not seeing what I'm doing wrong base upon online documents such as this. https://analystcave.com/vba-vba-class-tutorial/