View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_537_] Leith Ross[_537_] is offline
external usenet poster
 
Posts: 1
Default Identifying controls on MultiPage Pages


Hello Rhumba,

This code will return the owner of any CheckBox that is checked. The
Parent property will return the name of the "Container" object for the
control. Some common container objects are UserForms, Frames, and
MultiPage objects. If you have a Checkbox in a Frame, the first
instance of the Parent property is the name of the Frame, the second is
the MultiPage, and then the UserForm.

For Each Ctrl In Me.Controls
If TypeName(Ctrl) = "CheckBox" And Ctrl.Object.Value = True
Then
Owner = Ctrl.Parent.Name
End If
Next Ctrl


To get the CheckBox Owner on a Frame would be...
Owner = Ctrl.Parent.Parent.Name

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=509221