UserForm Optionbutton

excel_help_101

Board Regular
Joined
Jul 18, 2012
Messages
139
hello all,
I am looking for a way so when i open up a userform data in a activecell will tell an optionbutton to be true, but I can get it to work

this is the code i am stying to work with

Sub Button1_Click()
Application.Visible = False
UserForm1.Show
If ActiveCell.Formula("N2") = "1" Then
OptionButton1 = True
End If
End Sub

thanks
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Good morning,
By the description of what you want, I would add an event to your userform...

Code:
Private Sub UserForm_Activate()
If ActiveCell.Value = "1" Then
    OptionButton1.Value = True
End If

End Sub

This will cause optionbutton1 to be selected if the active cell is 1 at the time the user opens the form.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,721
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top