plwhittington
Board Regular
- Joined
- May 10, 2007
- Messages
- 132
Using VBA, I am creating a sheet with two Group Boxes (Forms Controls)- each Group Box has two Option Buttons. Can someone tell me how to keep all four of the option buttons from all being linked/grouped?
I want the user to make two selections on the sheet- one option button selected in each group box. Right now, only one of the option buttons can be selected at a time.
Can someone tell me how to make the one group of four buttons two groups of two?
I have tried linking two to one cell and two to another, but didn't help. They all link to the last cell I selected.
______________________________________________________________________
Below is the code I am using:
'GROUP BOX 1
With ActiveSheet.GroupBoxes.Add(20, 10, 85, 40)
.Name = "Group Box 1"
ActiveSheet.GroupBoxes("Group Box 1").Caption = "Report Selection"
End With
'OPTION BUTTON 1
With ActiveSheet.OptionButtons.Add(25.5, 13, 93, 22)
.Name = "Option Button 1"
.OnAction = "A7ReportCriteria"
.Caption = "Summary"
End With
'OPTION BUTTON 2
With ActiveSheet.OptionButtons.Add(25.5, 28, 93, 17.25)
.Name = "Option Button 2"
.OnAction = "A7ReportCriteria"
.Caption = "Detail"
End With
'GROUP BOX 2
With ActiveSheet.GroupBoxes.Add(105, 10, 85, 40)
.Name = "Group Box 2"
ActiveSheet.GroupBoxes("Group Box 2").Caption = "Sort"
End With
'OPTION BUTTON 3
With ActiveSheet.OptionButtons.Add(110.5, 13, 93, 22)
.Name = "Option Button 3"
.OnAction = "A8ReportCriteria"
.Caption = "by Seller"
End With
End If
'OPTION BUTTON 4
With ActiveSheet.OptionButtons.Add(110.5, 28, 93, 17.25)
.Name = "Option Button 4"
.OnAction = "A8ReportCriteria"
.Caption = "by Partner"
End With
Thanks.
I want the user to make two selections on the sheet- one option button selected in each group box. Right now, only one of the option buttons can be selected at a time.
Can someone tell me how to make the one group of four buttons two groups of two?
I have tried linking two to one cell and two to another, but didn't help. They all link to the last cell I selected.
______________________________________________________________________
Below is the code I am using:
'GROUP BOX 1
With ActiveSheet.GroupBoxes.Add(20, 10, 85, 40)
.Name = "Group Box 1"
ActiveSheet.GroupBoxes("Group Box 1").Caption = "Report Selection"
End With
'OPTION BUTTON 1
With ActiveSheet.OptionButtons.Add(25.5, 13, 93, 22)
.Name = "Option Button 1"
.OnAction = "A7ReportCriteria"
.Caption = "Summary"
End With
'OPTION BUTTON 2
With ActiveSheet.OptionButtons.Add(25.5, 28, 93, 17.25)
.Name = "Option Button 2"
.OnAction = "A7ReportCriteria"
.Caption = "Detail"
End With
'GROUP BOX 2
With ActiveSheet.GroupBoxes.Add(105, 10, 85, 40)
.Name = "Group Box 2"
ActiveSheet.GroupBoxes("Group Box 2").Caption = "Sort"
End With
'OPTION BUTTON 3
With ActiveSheet.OptionButtons.Add(110.5, 13, 93, 22)
.Name = "Option Button 3"
.OnAction = "A8ReportCriteria"
.Caption = "by Seller"
End With
End If
'OPTION BUTTON 4
With ActiveSheet.OptionButtons.Add(110.5, 28, 93, 17.25)
.Name = "Option Button 4"
.OnAction = "A8ReportCriteria"
.Caption = "by Partner"
End With
Thanks.