Quickest way to clear all sheet contents VBA

前端 未结 4 1992
星月不相逢
星月不相逢 2021-02-03 18:05

I have a large sheet that I need to delete all the contents of. When I try to simply clear it without VBA it goes into not responding mode. When using a macro such as:



        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 18:14

    You can use the .Clear method:

    Sheets("Zeros").UsedRange.Clear
    

    Using this you can remove the contents and the formatting of a cell or range without affecting the rest of the worksheet.

提交回复
热议问题