Suppose I have a few TextBoxes in a VBA form, called Text1,Text2,Text3. I'm looking for a way to do something like:
For i = 1 To 4
(Text&i).Text=i
Next
This is just a very simple example of what I want to do. I want to be able to form an object name programatically on run-time and then do something with the object. In this simple case I want Text1.Text=1, Text2.Text=2,Text3.Text=3.
Is there any way to do something like this?
Me.Controls("Text" & i).Text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With