title: VBA - How the colon `:` works in VBA code with condition
body: <p>The colon operator <code>:</code> is a statement delimiter in VBA.</p>
  
  <p>However, does anyone has a clue why the first three examples work and the fourth (when uncommented) produces an error?</p>
  
  <pre><code>Option Explicit
  
  Public Sub TestMe()
  
      If 1 = 1 Then: Debug.Print 1
  
      If 2 = 2 Then Debug.Print 2
  
      If 3 = 3 Then:
          Debug.Print 3
  
  '   Gives error:
  '    If 4 = 4 Then
  '        Debug.Print 4
  
  'Other Examples, from the comments and the answers:
  
  ::::::::::::::::::::::::::::         '&lt;-- This seems to be ok
  
      If 5 = 5 Then Debug.Print "5a"::: Debug.Print "5b"
      If 6 = 0 Then Debug.Print "6a"::: Debug.Print "6b"
  
      If 7 = 0 Then:
          Debug.Print 7 ' Does not have anything to do with the condition...
  
      If 8 = 0 Then Debug.Print "8a"::: Debug.Print "8b" Else Debug.Print "8c"
  
  End Sub
  </code></pre>