Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default deleting data but not formulae in multiple sheets

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default deleting data but not formulae in multiple sheets

....and if it DOES work save a copy as a template for future years!

"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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default deleting data but not formulae in multiple sheets

On Jul 16, 10:13*pm, Charlie
wrote:
...and if it DOES work save a copy as a template for future years!

"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


Thanks Charlie. I will give this a whirl. Yes, I realise I should have
saved a blank-ish one as a template! Thanks. will let u know how I get
on
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default deleting data but not formulae in multiple sheets

On Jul 16, 10:13*pm, Charlie
wrote:
...and if it DOES work save a copy as a template for future years!

"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


worked brilliantly! Thanks, Charlie :-)


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default deleting data but not formulae in multiple sheets

You could also protect the cells that contain the formula and not the ones
that are to receive data (and protect the Sheets, of course). That would
make it hard for anyone to accidentally (or maliciously) overwrite the
formulae, especially if you passworded the protection.
--


Time is just the thing that keeps everything from happening all at once


"Terry Freedman" wrote:

On Jul 16, 10:13 pm, Charlie
wrote:
...and if it DOES work save a copy as a template for future years!

"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


worked brilliantly! Thanks, Charlie :-)

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
Deleting the DATA but NOT the Formulae! Big Gray Cat[_2_] Excel Discussion (Misc queries) 1 November 11th 08 04:59 PM
formulae to look at 52 sheets &count if 2 cells have data entered bsnapool Excel Discussion (Misc queries) 1 July 10th 06 09:42 PM
formulae to look at 52 sheets &count if 2 cells have data entered bsnapool Excel Discussion (Misc queries) 0 July 10th 06 03:53 PM
Deleting multiple sheets hshayh0rn Excel Programming 12 April 11th 06 06:52 PM
repost; Automatically updating formulae in multiple sheets Keith Nicholls Excel Discussion (Misc queries) 1 January 5th 06 03:39 AM


All times are GMT +1. The time now is 01:37 PM.

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

About Us

"It's about Microsoft Excel"