check textboxes for input

peioz

Board Regular
Joined
Jul 17, 2002
Messages
78
Hello,

Is there a way to easily check if all (a lot)textboxes in my userform are filled in by the user ?

Thnx in advance.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi peioz,

Two possibilities occur to me:

1. A simple loop through all of the textboxes checking for entries, or

2. Forcing users to enter data in one box at a time. Eg, the user can't move to box2 until there is data entered in box1.

Are either of these approaches practical?
 
Upvote 0
On 2002-08-23 03:54, Richie(UK) wrote:
Hi peioz,

Two possibilities occur to me:

1. A simple loop through all of the textboxes checking for entries, or

2. Forcing users to enter data in one box at a time. Eg, the user can't move to box2 until there is data entered in box1.

Are either of these approaches practical?

I quess the first option would be practical, but what I want to prevent is typing each name of the textbox seperately...
 
Upvote 0
Hi,

Could you modify something along these lines?

<pre>
Private Sub UserForm_Initialize()
Dim MyControl As Control
Dim i As Integer

For Each MyControl In Controls
If (MyControl.Name Like "TextBox*") Then i = i + 1
Next

MsgBox "There are " & i & " TextBoxes on the UserForm."

End Sub

</pre>

HTH
 
Upvote 0
On 2002-08-23 04:40, Richie(UK) wrote:
Hi,

Could you modify something along these lines?

<pre>
Private Sub UserForm_Initialize()
Dim MyControl As Control
Dim i As Integer

For Each MyControl In Controls
If (MyControl.Name Like "TextBox*") Then i = i + 1
Next

MsgBox "There are " & i & " TextBoxes on the UserForm."

End Sub

</pre>

HTH

I'll try it out ! thnx !
 
Upvote 0

Forum statistics

Threads
1,214,416
Messages
6,119,384
Members
448,889
Latest member
TS_711

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top