Ability to force a user to check off all groups of option buttons

raccoon588

Board Regular
Joined
Aug 5, 2016
Messages
118
I have a form with several groupings of option buttons. Is it possible to force a user to ensure all groups have at least one option selected before moving forward with the save copy button? Here is my current code. As you can see i do have the requirement for them to fill in a specific cell. Now i just need to also require all option groups have at least one selection filled in.

Code:
 Sub CommandButton1_Click()
ActiveSheet.Unprotect
Dim nom As String
Dim path As String
If Range("H48") = "" Then
MsgBox ("You Messed Up"), ActiveSheet.Protect, exitsub
Else
    path = "\\hinas1\MFG\S8WData\Christine Myhaver\Training"
    nom = Day(Date) & "-" & Month(Date) & "-" & Year(Date) & "(" & Hour(Time) & "-" & Minute(Time) & ")-" & ActiveWorkbook.Name
    ActiveWorkbook.SaveCopyAs path & "\" & nom
    rep = MsgBox("Submited")
    
     ActiveSheet.CheckBoxes.Value = False
     Range("H48,G39,H39,G42,H42,G43,H43,G44,H44,G45,H45").ClearContents
     ActiveSheet.Protect
     Application.DisplayAlerts = False
     Application.Quit
   End If
End Sub
 
Last edited:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Since only one option button can be selected from any one group, simply loop through all option buttons, and count the number of option buttons that have been selected. If that count equals the number of groups that you have, then you'll know that a selection has been made from each group.
 
Upvote 0

Forum statistics

Threads
1,223,155
Messages
6,170,405
Members
452,325
Latest member
BlahQz

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