Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have a userform that has over 30 textboxes. I need to check the database and if a certain value is returned that matches a particular textbox, I need to turn the backcolor to blue. How do I loop through all the textboxes on a userform? Here is the pseudo code of what I am trying to do: For i=1 to userform.controls if control.i.typename = " LISTBOX" then if left(control.i.name,5) = "table" then CheckFlag = CheckTable(control.i.name) if CheckFlag then control.i.backcolor = Green end if end if end if next |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
something like this should do what you want.
Dim ctl As Control For Each ctl In UserForm1.Controls If TypeName(ctl) = "TextBox" Then 'do you stuff here End If Next -- jb "Webtechie" wrote: Hello, I have a userform that has over 30 textboxes. I need to check the database and if a certain value is returned that matches a particular textbox, I need to turn the backcolor to blue. How do I loop through all the textboxes on a userform? Here is the pseudo code of what I am trying to do: For i=1 to userform.controls if control.i.typename = " LISTBOX" then if left(control.i.name,5) = "table" then CheckFlag = CheckTable(control.i.name) if CheckFlag then control.i.backcolor = Green end if end if end if next |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks!!
"john" wrote: something like this should do what you want. Dim ctl As Control For Each ctl In UserForm1.Controls If TypeName(ctl) = "TextBox" Then 'do you stuff here End If Next -- jb "Webtechie" wrote: Hello, I have a userform that has over 30 textboxes. I need to check the database and if a certain value is returned that matches a particular textbox, I need to turn the backcolor to blue. How do I loop through all the textboxes on a userform? Here is the pseudo code of what I am trying to do: For i=1 to userform.controls if control.i.typename = " LISTBOX" then if left(control.i.name,5) = "table" then CheckFlag = CheckTable(control.i.name) if CheckFlag then control.i.backcolor = Green end if end if end if next |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need a macro to loop evaluation of many textboxes in a UserForm. | Excel Programming | |||
UserForm TextBoxes | Excel Discussion (Misc queries) | |||
loop through textboxes only | Excel Programming | |||
userform textboxes again | Excel Programming | |||
userform textboxes | Excel Programming |