Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Users leaving blanks
I have a user input form and I am trying to stop users
leaving the fields empty. I am using the following code - If txtname.Value Is Null Then MsgBox "Please ensure all the boxes are filled before clicking OK" End Sub Where am I going wrong? Yvonne |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Users leaving blanks
Im assuming this is for the click event of the OK butto
try something like this Private Sub btnOk_Click( Dim txtbx As MSForms.TextBo For Each ctrl In Me.Control If TypeOf ctrl Is MSForms.TextBox The Set txtbx = ctr If txtbx.value = "" then msgbox "Please ensure all the boxes are filled before clicking OK txtbx.setfocu Exit Su End i End I Nex 'put your proceed if everything is ok code her End Su ----- Yvonne Wilder wrote: ---- I have a user input form and I am trying to stop users leaving the fields empty. I am using the following code If txtname.Value Is Null Then MsgBox "Please ensure all the boxes are filled before clicking OK" End Su Where am I going wrong Yvonn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
replacing zeros with blanks but leaving dates alone | Excel Worksheet Functions | |||
How to hide blank rows after data whilst leaving some blanks. | New Users to Excel | |||
Copy a column leaving out any blanks | Excel Worksheet Functions | |||
copy range of cells with blanks then paste without blanks | Excel Worksheet Functions | |||
Paste Special Skip Blanks not skipping blanks, but overwriting... | Excel Discussion (Misc queries) |