Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Selecting Certain Userform Controls

Is it possible to loop through only the controls on a specific page of a
multipage?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Design Selecting Controls MjMullen Excel Programming 2 September 13th 08 05:36 PM
Userform Controls jnf40 Excel Programming 1 October 18th 07 04:54 PM
Userform Controls Nigel Excel Programming 5 December 30th 04 01:49 PM
Help please with UserForm controls sa3214 Excel Programming 4 July 2nd 04 03:00 AM
Add controls to UserForm Vyyk Drago Excel Programming 3 August 26th 03 01:22 PM


All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"