PC Review


Reply
Thread Tools Rate Thread

Counting TextBox values

 
 
Patrick C. Simonds
Guest
Posts: n/a
 
      25th Jul 2009
I have a multipage UserForm. On page 2 are 3 TextBoxes (201, 205 and 209).
Each of these TextBoxes can have any one of 5 values (Yes, No, No Contact,
No Phone or Not Called. On page 1 I want to add a Textbox which tells me
how many of the TextBoxes had the value "No Contact"

 
Reply With Quote
 
 
 
 
john
Guest
Posts: n/a
 
      25th Jul 2009
Something like this may work for you - Palce behind the useform.
:

Sub CountNoContact()

Dim mycount As Integer
Dim ctl As Control
mycount = 0

For Each ctl In Me.Controls

If TypeName(ctl) = "TextBox" Then

If UCase(ctl.Text) = "NO CONTACT" Then

mycount = mycount + 1

End If

End If

Next

Me.TextBox1.Text = mycount

End Sub

--
jb


"Patrick C. Simonds" wrote:

> I have a multipage UserForm. On page 2 are 3 TextBoxes (201, 205 and 209).
> Each of these TextBoxes can have any one of 5 values (Yes, No, No Contact,
> No Phone or Not Called. On page 1 I want to add a Textbox which tells me
> how many of the TextBoxes had the value "No Contact"
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting values in one cell based on values in another S2 Microsoft Excel Misc 5 18th Apr 2009 02:46 AM
counting rows with same values for multiple values Jon Viehe Microsoft Excel New Users 4 1st Sep 2005 03:49 PM
Counting rows, then counting values. Michael via OfficeKB.com Microsoft Excel Misc 7 4th Aug 2005 10:57 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Microsoft Excel Programming 1 1st Jun 2005 04:10 PM
Counting unique values and all values in same query John Morrissey Microsoft Access Queries 1 6th Aug 2004 12:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 PM.