View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
stewart stewart is offline
external usenet poster
 
Posts: 44
Default Check all textboxes

Great. Works perfectly thank you

On May 7, 3:15 pm, merjet wrote:
On May 7, 1:35 pm, stewart wrote:

merjet,
this does work but is there a way to specify a certain page in a
multipage control. Also how do I stop it once it has found an empty
textbox.


You can specify the page, stop the Sub and set the focus on the empty
TextBox as follows.

Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is MSForms.TextBox And ctrl.Parent.Name = "Page1"
Then
If ctrl.Value = "" Then
MsgBox "fill it"
ctrl.SetFocus
Exit Sub
Else
MsgBox "its filled"
End If
End If
Next ctrl

Hth,
Merjet