Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I created my first Userform with a pair of OptionButtons.
So there two option buttons in my group and I need to know how to set or check one of the option buttons before or when the userform loads. How would I do this?? Btw, the option that gets set is going to depend on the contents of cell A1. so if cell A1 contains integer value of 1, then i want OptionButton1 to be set. If A1 == 2, then I want OptionButton2 to be set or checked. thank you. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 27 Nov 2009 20:55:15 -0700, "Robert Crandal"
wrote: I created my first Userform with a pair of OptionButtons. So there two option buttons in my group and I need to know how to set or check one of the option buttons before or when the userform loads. How would I do this?? Btw, the option that gets set is going to depend on the contents of cell A1. so if cell A1 contains integer value of 1, then i want OptionButton1 to be set. If A1 == 2, then I want OptionButton2 to be set or checked. thank you. Try this macro Private Sub UserForm_Activate() If Worksheets("Sheet1").Cells(1, "A").Value = 1 Then OptionButton1.Value = True End If If Worksheets("Sheet1").Cells(1, "A").Value = 2 Then OptionButton2.Value = True End If End Sub Hope this helps / Lars-Åke |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
UserForm OptionButtons | Excel Discussion (Misc queries) | |||
Hiding/Showing OptionButtons on a UserForm | Excel Programming | |||
CommandButtons and OptionButtons on Userform | Excel Programming | |||
Need help creating a userform with optionbuttons | Excel Programming | |||
optionbuttons | Excel Programming |