View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charlie Charlie is offline
external usenet poster
 
Posts: 703
Default deleting data but not formulae in multiple sheets

Try something like this, but MAKE A COPY of your workbook first in case it
doesn't work as you expect it to! ;)

Sub ClearCells()
'
Dim Sheet As Worksheet
Dim Cell As Range
'
For Each Sheet In ThisWorkbook.Worksheets
Sheet.Activate
For Each Cell In ActiveSheet.UsedRange
If Left(Cell.Formula, 1) < "=" Then Cell.ClearContents
Next Cell
Next Sheet
'
End Sub


"Terry Freedman" wrote:

Hi

I need to clear the data in 12 worksheets at once (Jan to Dec), but
leave the formulae intact. Any ideas on a quick way of doing that with
a macro please?

Thanks
Terry