ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputting data from Userform (https://www.excelbanter.com/excel-programming/289983-inputting-data-userform.html)

Sony[_3_]

Inputting data from Userform
 
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?

Nigel[_8_]

Inputting data from Userform
 
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

"Sony" wrote in message
...
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?





----== 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 =---

No Name

Inputting data from Userform
 
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

"Sony" wrote in

message
...
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?





----== 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 =---
.



All times are GMT +1. The time now is 03:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com