Link to home
Create AccountLog in
Avatar of Fordraiders
FordraidersFlag for United States of America

asked on

check for an option box being selected on a spefic page

office 2010  excel vba
userform with mutlipage object and 10 "Pages"
I have code that will for any optionbutton being selected on a multipage object.


Dim cCont As Control
     
    For Each cCont In Me.Controls
        If TypeName(cCont) = "optionbutton" Then
            cCont.Value = False
        End If
    Next cCont

I need the code revised to specifically lokk at "Page"  like "page1"

Then if any optionbutton selected = true then
 do something..

Dim cCont As Control
     
    For Each cCont In Me.Controls
        If TypeName(cCont) = "optionbutton" Then
            ' do something here...
        End If
    Next cCont

Thanks
fordraiders
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

It looks like the code you posted is in a UserForm. Correct? Are you saying that you want to modify that code to look for controls on a sheet named 'Page1'?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Fordraiders

ASKER

Thanks
You're welcome and I'm glad I could help.

Marty - MVP 2009 to 2012