Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Certain Userform Controls
Is it possible to loop through only the controls on a specific page of a
multipage? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Certain Userform Controls
Hi Jeremy,
The following example loops through the pages of a Multipage and loops through the controls on each page. Note that the page index start at zero. Sub MultiPageLoop() Dim i As Integer Dim objCtrl As Object With UserForm1 For i = 0 To .MultiPage1.Count - 1 With .MultiPage1.Pages(i) For Each objCtrl In .Controls MsgBox objCtrl.Name Next objCtrl End With Next i End With End Sub -- Regards, OssieMac "JeremyJ" wrote: Is it possible to loop through only the controls on a specific page of a multipage? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting Certain Userform Controls
Yes, you can do that. In the code that follows, just replace the Debug.Print
statement with the code you want to execute for each of the controls on the specified page... Dim C As Control Dim PageToLoopThru As Long ' Remember, pages are numbered starting at zero, so this ' line will select the THIRD tab on the MultiPage for the loop PageToLoopThru = 2 For Each C In MultiPage1.Pages(PageToLoopThru).Controls Debug.Print C.Name Next -- Rick (MVP - Excel) "JeremyJ" wrote in message ... Is it possible to loop through only the controls on a specific page of a multipage? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Design Selecting Controls | Excel Programming | |||
Userform Controls | Excel Programming | |||
Userform Controls | Excel Programming | |||
Help please with UserForm controls | Excel Programming | |||
Add controls to UserForm | Excel Programming |