littlewoman
Programmer
Using Excel 2003-vba, I have a userform with several textboxes for descriptions and named them tbxDescription1 to tbxDescription9
Now I need to loop through them in serveral occassions and tried to accomplish that by following code
dim obj as object
for cnt = 1 to 9
cnt$ = right(str(cnt),1)
objectname = "tbxDescription" + cnt$
set obj = objectname
Now I need to loop through them in serveral occassions and tried to accomplish that by following code
dim obj as object
for cnt = 1 to 9
cnt$ = right(str(cnt),1)
objectname = "tbxDescription" + cnt$
set obj = objectname
Code:
next cnt
every time I get: object required on the 'set obj =' line
As a newby guessing it was in the syntax I've tried also:
set obj = tbxDescription & cnt$
set obj = [objectnaam]
set obj = objectnaam.value
I'm running out of clues and searching for 3 days now for an answer on a lot of forums but couldn't find an answer for such a simple thing. Everybody posting seem to be much more technical than where I am today.
Therefor: plse can anyone tell me if there is a way to refer to form-objects without having to write code for every object individually?