I have a User Form with 8 Check Boxes where user can check one or all of the Check Boxes. There is a different command for each Check Box and I need the code to test if each or all of the Check Boxes are checked and then run the code assigned to each check box. I have written the code with If statements below for reference. Any help would be greatly appreciated. Thanks.
Private Sub OKButton_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
If CheckBox40 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="40°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBox70 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="70°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBox80 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="80°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBox100 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="100°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxIndirect = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="Indirect,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxDirect = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="Direct,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxUV = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="UV,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxFreezer = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="Freezer", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Else
End If
MsgBox "Are You Sure You Want to Cancel These Conditions"
Columns("N:GS").Select
Selection.EntireColumn.Hidden = True
Range("B2000").End(xlUp).Offset(1, 0).Select
ConditionsCancel.Hide
Application.ScreenUpdating = False
Application.EnableEvents = False
End Sub
Private Sub OKButton_Click()
Application.ScreenUpdating = False
Application.EnableEvents = False
If CheckBox40 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="40°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBox70 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="70°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBox80 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="80°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBox100 = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="100°,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxIndirect = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="Indirect,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxDirect = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="Direct,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxUV = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="UV,", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
If CheckBoxFreezer = True Then
ActiveCell.Offset(0, 62).Range("A1:X1").Select
Selection.Replace What:="Freezer", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Else
End If
MsgBox "Are You Sure You Want to Cancel These Conditions"
Columns("N:GS").Select
Selection.EntireColumn.Hidden = True
Range("B2000").End(xlUp).Offset(1, 0).Select
ConditionsCancel.Hide
Application.ScreenUpdating = False
Application.EnableEvents = False
End Sub