I am somewhat new to coding and may not use the correct terminology, hopefully, what I say makes sense.
I have created a class module to build objects. My class module currently has some variables (I intend to add some methods as I build upon my code).
'CLASS MODULE NAMED clsNodes
Public i As Single
Public j As Single
Public coll As Collection
My module will build objects based on cell value input by the user
Option Explicit
Dim i As Single, j As Single
Dim ni_nodes As Single, nj_anchors As Single
ni_nodes = range("A1")
nj_nodes = range("A2")
For i = 1 to ni_nodes
For j = 1 to nj_nodes
Set node = New clsNodes
node.i = i
node.j = j
Next j
Next i
The current problem with my code is that when it steps through my for loop the object node is overwritten every step it runs through the j for loop.
What I want to do is create a new object or add the object to a collection so I can easily reference the object and its variables. For example in my module I would like to call up my nodes similar to...
1stnode_i_value = node(1).i
3rdnode_j_value = node(3).j
Hopefully, this makes sense... I may not be using the best approach so please enlightened me.