Mega Code Archive

 
Categories / VisualBasic Script / Language Basics
 

For Next Loop

Sub GetTextBoxNames()         Dim myForm As Form         Dim myControl As Control         Dim c As Integer         Set myForm = Screen.ActiveForm         Set myControl = Screen.ActiveControl         For c = 0 To myForm.Count - 1             If TypeOf myForm(c) Is TextBox Then                 MsgBox myForm(c).Name             End If         Next c     End Sub