I have a long list in an excel spreadsheet, and for each cell I would like to create a new object, but I can't figure out how to do it.
I have something like:
Dim k As Integer
k = 0
Do
If ActiveCell.Offset(k, 0).Value = "" Then Exit Do
Dim Player&k As New CPlayer
'Attempting to create a new object with name Player0, Player1, ...
Set Player&k.Name = ActiveCell.Offset(k, 0).Value
k = k + 1
Loop
As you can probably tell, I don't know much about VBA or object oriented programming, I just have one task I'm trying to accomplish. The code above results in a compile error, so is obviously not the correct way to do this, is there a simple way to do what I'm trying for or not really?