Message 1 of 3
Step through text boxes (objects) with code

Not applicable
10-05-2007
08:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
VBA noobie question . . .
Is it possible to step through text boxes (or any object) with code
Here's a rough sample trying to manipulate TextBox1 and TextBox2:
sub tboxmod()
Dim n As Integer
Dim Tname As String
For n = 1 To 2
Tname = "TextBox" & n
Dim TBox As TextBox
Set TBox = Tname
TBox.Text = "n"
Next n
End Sub
Thanks in advance
Is it possible to step through text boxes (or any object) with code
Here's a rough sample trying to manipulate TextBox1 and TextBox2:
sub tboxmod()
Dim n As Integer
Dim Tname As String
For n = 1 To 2
Tname = "TextBox" & n
Dim TBox As TextBox
Set TBox = Tname
TBox.Text = "n"
Next n
End Sub
Thanks in advance