title: Mandatory Merged Cell Input for excel 2016
body: <p>I had a merged cell from D4 to H4, I want the cells to be mandatory. I had tried the following code but does not work.</p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Dim c As Range
  Dim cel As Range
  
  Set c = Range("D4:H4")
  
  Application.EnableEvents = False
  If Not Intersect(Target, c) Is Nothing Then
    For Each cel In c
      If cel.Text = "" Then
        Application.Goto reference:=c, Scroll:=True
        MsgBox ("Field Cannot Be Blank")
        Exit For
      End If
    Next cel
  End If
  Application.EnableEvents = True
  End Sub
  </code></pre>
  
  <p>I also had another cell need to be mandatory, H2. This code already works, I want to combine the codes for D4 to H4 and H2 together.</p>
  
  <pre><code>Private Sub Workbook_BeforeClose(Cancel As Boolean)
  If Cells(2, 8).Value = "" Then
    MsgBox "Cell H2 requires user input", vbInformation, "Please filled up the 
    mandatory cells"
    Cancel = True
  End If
  End Sub
  </code></pre>
  
  <p>Any help and suggestion is appreciated.</p>