Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 137
Default 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 ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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 ?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 137
Default 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 ?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active sheet instead of a "sheet1" for Macro Pantera Excel Worksheet Functions 7 December 31st 08 07:47 PM
"ClearContents" command halts code Dave O Excel Discussion (Misc queries) 3 January 10th 08 03:39 PM
how do i convert this to a formula +"sheet1!J"&(sheet2!A30)-1 joel Excel Worksheet Functions 3 December 5th 07 01:48 PM
How do I color code the "SHEET1" Tab in Excel? kmtg Excel Worksheet Functions 3 June 14th 06 04:13 PM
Auto "copy and paste" individual cells from various sheets into one sheet ?? [email protected] Excel Discussion (Misc queries) 2 March 1st 06 03:19 AM


All times are GMT +1. The time now is 11:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"