Thanks, this works fine for this moment.
Gert-Jan
"Gary Keramidas" <GKeramidasATmsn.com> schreef in bericht
news:(E-Mail Removed)...
> if you only have 3 option buttons:
>
> If Me.OptionButton1.Value = False And Me.OptionButton2.Value = False And _
> Me.OptionButton3.Value = False Then MsgBox " you must select an option
> button"
>
>
> --
>
>
> Gary
>
>
> "Gert-Jan" <(E-Mail Removed)> wrote in message
> news:458b2495$0$23134$(E-Mail Removed)...
>>I see what you want to do, but this is not what I want (and it also
>>doesn't work). In my userform I have three option buttons. Final
>>operation: check if one of the optionbuttons is clicked. If not: msgbox
>>"please select an option first"
>>
>> Gert-Jan
>>
>> "Gary Keramidas" <GKeramidasATmsn.com> schreef in bericht
>> news:(E-Mail Removed)...
>>> maybe something like this, change userform1 to your userform name
>>>
>>> Dim optionbuttom As Control
>>> For Each OptionButton In UserForm1.Controls
>>> If OptionButton.Value = True Then
>>> MsgBox OptionButton.Caption & " = True"
>>> End If
>>> Next
>>>
>>> --
>>>
>>>
>>> Gary
>>>
>>>
>>> "Gert-Jan" <(E-Mail Removed)> wrote in message
>>> news:458b1a36$0$17958$(E-Mail Removed)...
>>>> Hi Martin,
>>>>
>>>> Thanks, but I know what I have to do. Isn't there a way to do this
>>>> simple and fast (not depending on the number of optionbuttons)?
>>>>
>>>> Gert-Jan
>>>>
>>>> "Martin Fishlock" <(E-Mail Removed)> schreef in
>>>> bericht news:85E710C4-79B5-4485-BCFB-(E-Mail Removed)...
>>>>> Hi,
>>>>>
>>>>> You need to check each of the buttons for true.
>>>>>
>>>>> Another way is to seta default for button1 to true in the form design
>>>>> (or at
>>>>> initialization).
>>>>>
>>>>> --
>>>>> Hope this helps
>>>>> Martin Fishlock, Bangkok, Thailand
>>>>> Please do not forget to rate this reply.
>>>>>
>>>>>
>>>>> "Gert-Jan" wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> In a userform I use three optionbuttons. One of them must be selected
>>>>>> by the
>>>>>> user. How can let VBA check if this is done?
>>>>>>
>>>>>> Regards, Gert-Jan
>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
|