Z
ZootRot
Excel 2003 VBA
I'm getting an error "next without for" in the following, simple code.
Doesn't make sense to me. Any help?
Private Sub CommandButton3_Click()
Dim MyControl As Control
For Each MyControl In Me
If TypeOf MyControl Is TextBox Then
MyControl.Text = ""
ElseIf TypeOf MyControl Is Label Then
MyControl.Caption = ""
Next MyControl
End Sub
I'm getting an error "next without for" in the following, simple code.
Doesn't make sense to me. Any help?
Private Sub CommandButton3_Click()
Dim MyControl As Control
For Each MyControl In Me
If TypeOf MyControl Is TextBox Then
MyControl.Text = ""
ElseIf TypeOf MyControl Is Label Then
MyControl.Caption = ""
Next MyControl
End Sub