ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sheets("Sheet1").Cells.ClearContents (https://www.excelbanter.com/excel-discussion-misc-queries/244244-sheets-sheet1-cells-clearcontents.html)

Seeker

Sheets("Sheet1").Cells.ClearContents
 
I have several worksheets which I would like to clear all contents and thus
it would be ready for data input next time. I tried Clear or ClearContents
but some sheets do not clean up, any idea please ?

Jacob Skaria

Sheets("Sheet1").Cells.ClearContents
 
Try the below macro

Sub Macro()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Sheets
sh.Cells.ClearContents
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Seeker" wrote:

I have several worksheets which I would like to clear all contents and thus
it would be ready for data input next time. I tried Clear or ClearContents
but some sheets do not clean up, any idea please ?


Seeker

Sheets("Sheet1").Cells.ClearContents
 
Tks Jacob.

"Jacob Skaria" wrote:

Try the below macro

Sub Macro()
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Sheets
sh.Cells.ClearContents
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Seeker" wrote:

I have several worksheets which I would like to clear all contents and thus
it would be ready for data input next time. I tried Clear or ClearContents
but some sheets do not clean up, any idea please ?



All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com