Vba Clear Sheet - Have questions or feedback about office vba or this documentation? This example clears the formulas and formatting in cells a1:g37 on sheet1. Just clear the usedrange instead: Web that's going to take a while. Expression a variable that represents a range object. Sub clearallsheets() dim ws as worksheet ' loop through each worksheet and clear all cells for each ws in thisworkbook.worksheets ws.cells.clear next ws end sub Web below is the vba code that would clear all the sheets in the workbook in which the code is run:
Expression a variable that represents a range object. Sub clearallsheets() dim ws as worksheet ' loop through each worksheet and clear all cells for each ws in thisworkbook.worksheets ws.cells.clear next ws end sub This example clears the formulas and formatting in cells a1:g37 on sheet1. Web below is the vba code that would clear all the sheets in the workbook in which the code is run: Web that's going to take a while. Just clear the usedrange instead: Have questions or feedback about office vba or this documentation?