PC Review


Reply
Thread Tools Rate Thread

deleting data but not formulae in multiple sheets

 
 
Terry Freedman
Guest
Posts: n/a
 
      16th Jul 2008
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
 
Reply With Quote
 
 
 
 
Charlie
Guest
Posts: n/a
 
      16th Jul 2008
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
>

 
Reply With Quote
 
Charlie
Guest
Posts: n/a
 
      16th Jul 2008
....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
>

 
Reply With Quote
 
Terry Freedman
Guest
Posts: n/a
 
      16th Jul 2008
On Jul 16, 10:13*pm, Charlie <Char...@discussions.microsoft.com>
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
 
Reply With Quote
 
Terry Freedman
Guest
Posts: n/a
 
      16th Jul 2008
On Jul 16, 10:13*pm, Charlie <Char...@discussions.microsoft.com>
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 With Quote
 
Neptune Dinosaur
Guest
Posts: n/a
 
      17th Jul 2008
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 <Char...@discussions.microsoft.com>
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting the DATA but NOT the Formulae! Big Gray Cat Microsoft Excel Misc 1 11th Nov 2008 04:59 PM
formulae to look at 52 sheets &count if 2 cells have data entered bsnapool Microsoft Excel Misc 1 10th Jul 2006 09:42 PM
formulae to look at 52 sheets &count if 2 cells have data entered bsnapool Microsoft Excel Misc 1 10th Jul 2006 04:55 PM
formulae to look at 52 sheets &count if 2 cells have data entered bsnapool Microsoft Excel Misc 0 10th Jul 2006 03:53 PM
repost; Automatically updating formulae in multiple sheets =?Utf-8?B?S2VpdGggTmljaG9sbHM=?= Microsoft Excel Misc 1 5th Jan 2006 03:39 AM


Features
 

Advertising
 

Newsgroups
 


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