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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
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,214,813
Messages
6,121,705
Members
449,048
Latest member
81jamesacct

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