View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default OptionButton. Reset to 0

Dim oOLE As OLEObject

With Worksheets("vragen")
For Each oOLE In .OLEObjects
If TypeName(oOLE.Object) = "OptionButton" Then
oOLE.Object.Value = 0
End If
Next oOLE
End With


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Eef Houniet" wrote in message
...
Bob,

Thank you for answering my question.
Your suggestion works for one OptionButton.

I worked this out as follows (I that there are 66 buttons):

Dim tel As Integer
Let tel = 1
Sheets("vragen").Activate
With ActiveSheet
Do While tel < 66
Me.OLEObjects("OptionButton" & tel).Object.value = 0
tel = tel + 1
Loop
End With

However, I think a construction using For Each - Next is better.
Any suggestions?
Thanking you in advance

"Bob Phillips" schreef in bericht
...
me.oleobjects("OptionButton1").object.value=0

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Eef Houniet" wrote in message
...
Readers,

Can OptionButtons be set to 0, using something like For each - Next

??

Up till now I know no better way then

Me.OptionButton1 = 0
Me.OptionButton2 = 0
Me.OptionButton3 = 0
Me.OptionButton4 = 0

Thanks,
Eef