![]() |
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" |
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" |
All times are GMT +1. The time now is 10:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com