title: Warning Message Before Running Macro (Excel)
body: <p>I am trying to add a warning message when running a macro in Excel.</p>
  
  <p>The warning message is to provide an option to 'cancel' prior to running the code below to clear cells.</p>
  
  <p>When trying to add a message box to that below, where the user is encouraged to activate the macro from the ribbon, I cannot seem to get it to run without errors.</p>
  
  <p>The sheet is locked, so only unlocked cells are to be cleared.</p>
  
  <pre><code>Sub Glazing_ClearContents(rib As IRibbonControl)
  Dim rng As Range
  Dim C As Variant
  Set rng = Sheets("Glazing_Systems").Range("C12:I42")
      For Each C In rng
          If C.Locked = False Then
              C.ClearContents
          Else
          End If
  Next C
  End Sub
  </code></pre>