Object problem
If you have named your OptionButtons objOB1, objOB2, etc then you can use
For n = 1 To 12
If objOB & n = True Then month = n
Next
"Joao" wrote:
I have 12 optionbuttons and I am trying to run this code:
objOB1...objOB12
Private objOB As Object
...
Set objOB = OptionButton
For n = 1 To 12
If objOB(n).Value = True Then Month = n
Next n
but it gives me a Run-time error '91'
What I am doing wrong?
|