Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Counting TextBox values

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"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Counting TextBox values

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
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
Counting values in one cell based on values in another S2 Excel Discussion (Misc queries) 7 April 18th 09 02:46 AM
Counting character in textbox in userform Gert-Jan Excel Programming 3 June 20th 06 12:48 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting Rows Then Counting Values in Columns Michael via OfficeKB.com Excel Programming 1 June 1st 05 04:10 PM
Possibility of counting line in textbox?? Bob Kilmer Excel Programming 1 August 11th 03 11:15 PM


All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"