Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone know of a web site, tutorial, or bit of code I can attach to a
button to check its userform for blanks (no entry). I would like form to check to see if there are any missing answers and if every question has been answered, then it posts the values to the spreadsheet. I've tried a few things , and made a lot of searches, but all for naught. Thanks, WillRn |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer" Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... Does anyone know of a web site, tutorial, or bit of code I can attach to a button to check its userform for blanks (no entry). I would like form to check to see if there are any missing answers and if every question has been answered, then it posts the values to the spreadsheet. I've tried a few things , and made a lot of searches, but all for naught. Thanks, WillRn |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This worked for checking the form, but I would really like the code to take
the user to the missing answer and ask them to fill it in. Is this possible? "Bob Phillips" wrote: For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer" Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... Does anyone know of a web site, tutorial, or bit of code I can attach to a button to check its userform for blanks (no entry). I would like form to check to see if there are any missing answers and if every question has been answered, then it posts the values to the spreadsheet. I've tried a few things , and made a lot of searches, but all for naught. Thanks, WillRn |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer, please complete" ctl.Select Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... This worked for checking the form, but I would really like the code to take the user to the missing answer and ask them to fill it in. Is this possible? "Bob Phillips" wrote: For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer" Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... Does anyone know of a web site, tutorial, or bit of code I can attach to a button to check its userform for blanks (no entry). I would like form to check to see if there are any missing answers and if every question has been answered, then it posts the values to the spreadsheet. I've tried a few things , and made a lot of searches, but all for naught. Thanks, WillRn |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So far so good, but I keep getting: "Run-Time error '450' wrong number of
arguments or invalid property assignment. "Bob Phillips" wrote: For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer, please complete" ctl.Select Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... This worked for checking the form, but I would really like the code to take the user to the missing answer and ask them to fill it in. Is this possible? "Bob Phillips" wrote: For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer" Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... Does anyone know of a web site, tutorial, or bit of code I can attach to a button to check its userform for blanks (no entry). I would like form to check to see if there are any missing answers and if every question has been answered, then it posts the values to the spreadsheet. I've tried a few things , and made a lot of searches, but all for naught. Thanks, WillRn |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wrong syntax
Dim ctl For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then MsgBox "Missing answer, please reset" ctl.SetFocus Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... So far so good, but I keep getting: "Run-Time error '450' wrong number of arguments or invalid property assignment. "Bob Phillips" wrote: For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer, please complete" ctl.Select Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... This worked for checking the form, but I would really like the code to take the user to the missing answer and ask them to fill it in. Is this possible? "Bob Phillips" wrote: For Each ctl In Me.Controls If TypeName(ctl) = "TextBox" Then If ctl.Text = "" Then Msgbox "Missing answer" Exit For End If End If Next ctl -- HTH RP (remove nothere from the email address if mailing direct) "WillRn" wrote in message ... Does anyone know of a web site, tutorial, or bit of code I can attach to a button to check its userform for blanks (no entry). I would like form to check to see if there are any missing answers and if every question has been answered, then it posts the values to the spreadsheet. I've tried a few things , and made a lot of searches, but all for naught. Thanks, WillRn |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking For Duplicate Entries in a Userform | Excel Discussion (Misc queries) | |||
Spell Checking with checking cell notes | Excel Discussion (Misc queries) | |||
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) | |||
Setup Spell Checking on Userform textboxes | Excel Programming |