title: Clear Range from sheet2
body: <p>I am new to Visual basic below is the code to delete the data from sheet2 with the desired range it is not working and i am getting the error.</p>
  
  <pre><code>Sub Clear()
  
  With ThisWorkbook
  With .Worksheets("Sheet2")
  ActiveSheet.Unprotect "": ActiveWorkbook.Unprotect ""
  Sheet2.Unprotect "": ActiveWorkbook.Unprotect ""
  Sheets("Sheet2").Range("B3:031").Clear
  Sheet2.Protect "": ActiveWorkbook.Protect ""
  ActiveSheet.Protect "": ActiveWorkbook.Protect ""
  End With
  ActiveWorkbook.Save
  ActiveWorkbook.Close
  End With
  End Sub
  </code></pre>