Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Counting values in one cell based on values in another | Excel Discussion (Misc queries) | |||
Counting character in textbox in userform | Excel Programming | |||
Counting rows, then counting values. | Excel Discussion (Misc queries) | |||
Counting Rows Then Counting Values in Columns | Excel Programming | |||
Possibility of counting line in textbox?? | Excel Programming |