Excel VBA Iterate Array of Range Objects -
i trying iterate through array of range references.
dim labels collection set labels = new collection dim mylabel range set mylabel = finddatarow(mysearchterms, currentworksheet) ' <- returns range labels.add (mylabel)
later i'm trying iterate through range references , following code not work: runtime error 424. understand object required, how did label become string.
dim label variant set label = nothing each label in labels debug.print (label & " in: " & label.row) next label
i have tried following this other answer here since i'm new vba in excel not understand how range reference put in data structure , later retrieved/referenced access label.row
want above (at point says "~~> whatever want range here")
my understanding far labels
is collection , not care type items in have. added range
references. can't retrieve them later. going wrong?
remove brackets add method forces value of range added collection rather object:
labels.add mylabel
Comments
Post a Comment