I figured out a code so that if a section is not filled out, the UserForm will not be able to be submitted.
However I am still wondering about the second question.
The code I have written is as follows -
Private Sub CommandButton1_Click()
Dim ans As Long
For Each ctrl In Me.Controls
Select Case True
Case TypeOf ctrl Is MSForms.CheckBox, TypeOf ctrl Is MSForms.OptionButton
Select Case ctrl.Value
Case True
ctrl.BackColor = vbGreen
Case Else
ctrl.BackColor = vbRed: ans = ans + 1
End Select
Case TypeOf ctrl Is MSForms.TextBox, TypeOf ctrl Is MSForms.ComboBox
Select Case ctrl.Value
Case vbNullString
ctrl.BackColor = vbRed: ans = ans + 1
Case Else
ctrl.BackColor = vbGreen
End Select
End Select
Next ctrl
If ans > 0 Then
MsgBox "Please enter data in the required fields. Controls in Red need values", vbInformation, "Enter data"
Exit Sub
Else
Dim TOF As Range
Set TOF = ActiveDocument.Bookmarks("TOF").Range
TOF.Text = Me.TextBox18.Value
Dim CS As Range
Set CS = ActiveDocument.Bookmarks("CS").Range
CS.Text = Me.TextBox20.Value
Dim NO As Range
Set NO = ActiveDocument.Bookmarks("NO").Range
NO.Text = Me.TextBox19.Value
Dim MY As Range
Set MY = ActiveDocument.Bookmarks("MY").Range
MY.Text = Me.TextBox21.Value
Dim TOF2 As Range
Set TOF2 = ActiveDocument.Bookmarks("TOF2").Range
TOF2.Text = Me.TextBox18.Value
Dim CS2 As Range
Set CS2 = ActiveDocument.Bookmarks("CS2").Range
CS2.Text = Me.TextBox20.Value
Me.Repaint
UserForm1.Hide
End If
End Sub
Private Sub UserForm_Click()
End Sub