I have tried my code again and it works.
I created a user form with optionbuttons (some inside a frame and other
outside)
At design time, I changed the value of some of the optionbuttons to true (of
course only one optionbutton could be set to true in each frame)
.
I run the code and all option buttons value was set to false (this is what I
believed you requested).
I run the code and added a line with debug.print ctl.name
the loop run through all the option buttons and the name of each one of them
appeared in the immediate window. which is the proof that each one of the
optionbuttons was indeed identified.
So, I guess I don't reallly understand what you are trying to do.
Of course, I did not mean that you renamed your controls "Frame1", etc... that
is exactly what I am trying to avoid.
The following is your code:
If InStr(1, ctl.Name, "Frame", vbTextCompare) Then
'MsgBox ("FrameName: " & ctl.Name)
Which means that you are checking the name of the control in order to know its
type. if your control is not named Frame but something like "myControl", you
will never be able to discover its type with this code.
I just meant to help you but if your code runs -as you said in one of your
last messages- so forget about mine.