Koesper
01-24-2006, 01:56 AM
Hi!
Until 2 weeks ago i was a complete newbie to VBA, but i've been trying to build a little something in excel to do several magical things to a worksheet filled with adresses. I've learned a lot so far, but i've still got a lot of questions... (who hasn't?)
But here is the one i'm currently fighting with:
My VBA dynamically adds new objects (labels) on the userform frmDemo, but in a different sub i want to do something with those new objects.
Their names are built up as a prefix "newLabel_" and a number.
in the other sub all the numbers are stored in newComboNumber, and from there i want to reference to those new comboboxes, but how?
could i do something like
frmDemo!newLabel_ & newLabelNumber.caption="something"
If i do this, i get the error that the object cannot be found,
while if i write the objectname without concatenating it with the number stored in the variable, it works like a charm!
frmDemo!newLabel_1.caption="something"
Can anyone point me in the right direction?
thanx!
Regards,
Casper
The Netherlands
Until 2 weeks ago i was a complete newbie to VBA, but i've been trying to build a little something in excel to do several magical things to a worksheet filled with adresses. I've learned a lot so far, but i've still got a lot of questions... (who hasn't?)
But here is the one i'm currently fighting with:
My VBA dynamically adds new objects (labels) on the userform frmDemo, but in a different sub i want to do something with those new objects.
Their names are built up as a prefix "newLabel_" and a number.
in the other sub all the numbers are stored in newComboNumber, and from there i want to reference to those new comboboxes, but how?
could i do something like
frmDemo!newLabel_ & newLabelNumber.caption="something"
If i do this, i get the error that the object cannot be found,
while if i write the objectname without concatenating it with the number stored in the variable, it works like a charm!
frmDemo!newLabel_1.caption="something"
Can anyone point me in the right direction?
thanx!
Regards,
Casper
The Netherlands