title: Check if Selected Range is Empty vba
body: <p>I am trying to achieve :</p>
  
  <ol>
  <li>if the Range A date is &lt; Current Date the MsgBox show it cannot be edit.  </li>
  <li>if the Range A date is = Current Date then it can be edit.   </li>
  <li>if the Range A date is empty then it can be edit.</li>
  </ol>
  
  <p>I can only do No.1 and No.2 but No.3 is not able to do it.
  Below here is my code. Kindly advise. Thanks.  </p>
  
  <pre><code>Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  'TEST
  If Range("A" &amp; Selection.Row).Value &lt; Date Then
      ActiveSheet.Protect Password:="123456"
      MsgBox "Only today's date row can be edited!", vbInformation, "TEST"
  ElseIf Range("A" &amp; Selection.Row).Value = Date Then
      ActiveSheet.Unprotect Password:="123456"
      ActiveSheet.EnableSelection = xlNoRestrictions
  ElseIf IsEmpty(Range("A" &amp; Selection.Row).Value) = Fals Then
      ActiveSheet.Unprotect Password:="123456"
      ActiveSheet.EnableSelection = xlNoRestrictions
  End If
  End Sub
  </code></pre>