Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping thru TextBoxes
I am trying to get some code to run in a series of textboxes on a
form. I found the bit of code below from Tom Ogilvy which appears to be able to do that. I put it on a code sheet with Public Sub LoopthruTextboxes() in front and End Sub at the end and ran it. The form opens on the screen but nothing else happens. I'm guessing that cntrl is not a keyword but a variable that needs to be defined as an object(?) When I get this working would I just put the code I want to repeat in place of "MsgBox cntrl.Name"? For Each cntrl In UserForm1.Controls i = 0 If TypeOf cntrl Is MSForms.TextBox Then i = i + 1 MsgBox cntrl.Name End If Next |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Looping thru TextBoxes
The problem is where you put the code. Put it the UserForm_Click()
event and click on the form when it appears (or have the UserForm_Click() event call your Sub). Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping through textboxes | Excel Discussion (Misc queries) | |||
tab between several textboxes | Excel Worksheet Functions | |||
sum of textboxes | Excel Programming | |||
Userform Textboxes and Looping | Excel Programming | |||
Textboxes | Excel Programming |