gibbo1715
10-09-2005, 01:53 AM
I am trying to use the code below to establish if a textbox on a userform has anything in it, but when i click on the button nothing happens at all, even when there is content in a TextBox
Anyone got any ideas please??
Private Sub CommandButton1_Click()
Dim ctrl As MSForms.Control
For Each ctrl In UserForm1.Controls
If Left(ctrl.Name, 9) = "Text" Then
If ctrl.Value <> "" Then
MsgBox ctrl.Name
End If
End If
Next
End Sub
Anyone got any ideas please??
Private Sub CommandButton1_Click()
Dim ctrl As MSForms.Control
For Each ctrl In UserForm1.Controls
If Left(ctrl.Name, 9) = "Text" Then
If ctrl.Value <> "" Then
MsgBox ctrl.Name
End If
End If
Next
End Sub