title: Clear contents and formatting of an Excel cell with a single command
body: <p>If you want to clear the contents of a cell or range in Microsoft Excel, you can use <code>.ClearContents</code>. If you also want to clear the formatting, you can use <code>.ClearFormats</code>.</p>
  
  <pre><code>Sheets("Test").Range("A1:C3").ClearContents
  Sheets("Test").Range("A1:C3").ClearFormats
  </code></pre>
  
  <p>If you want to do both, you can use <code>.Delete</code>, but then the other cells in the spreadsheet shift to replace the deleted cells.</p>
  
  <pre><code>Sheets("Test").Range("A1:C3").Delete
  </code></pre>
  
  <p>How can you remove the contents <em>and</em> the formatting of a cell or range in VBA with a single command, without affecting the rest of the worksheet?</p>