Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Checking a userform for blanks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Checking a userform for blanks


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Checking a userform for blanks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Checking a userform for blanks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Checking a userform for blanks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Checking a userform for blanks

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking For Duplicate Entries in a Userform robinsn Excel Discussion (Misc queries) 0 August 19th 10 01:28 PM
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
Paste Special Skip Blanks not skipping blanks, but overwriting... gsrosin Excel Discussion (Misc queries) 0 February 22nd 05 03:33 AM
Setup Spell Checking on Userform textboxes Charles Excel Programming 1 September 14th 04 12:58 PM


All times are GMT +1. The time now is 10:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"