Inputting data from Userform

  • Thread starter Thread starter Sony
  • Start date Start date
S

Sony

I have setup a user form that fills in Cells A through
D. I want to make sure that all the cells have data. Is
there a way to verify that all cells have data and if
they do not it prompts the user to enter the data before
the form can be sent, saved or closed?
 
One simple way..............

Private Sub CommandButton1_Click()
If Len(textbox1.Value) = 0 or Len(textbox2.Value) = 0 or
Len(TextBox3.Value) = 0 or Len(TextBox4.Value) = 0 Then
MsgBox "Not all values are entered"
Else
'do something else
End If
End Sub

Cheers
Nigel
 
That Worked great, thank you Nigel.
-----Original Message-----
One simple way..............

Private Sub CommandButton1_Click()
If Len(textbox1.Value) = 0 or Len(textbox2.Value) = 0 or
Len(TextBox3.Value) = 0 or Len(TextBox4.Value) = 0 Then
MsgBox "Not all values are entered"
Else
'do something else
End If
End Sub

Cheers
Nigel






----== Posted via Newsfeed.Com - Unlimited-Uncensored- Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
.
 
Back
Top