Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default keep formula delete contents

I'm trying to set up a template in Excel. I wish to keep the formula but
delete contents, so i can us the same sheet again.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default keep formula delete contents

Every formula evaluates to something -- a string, a number, an error, ...

So you can't really delete the contents and still keep the formula.

But you could modify the formula so that it returns an empty string ("") and
that makes the cell look empty.

You could modify the formula to look at the other cells it needs and if those
are empty, then return that "" string.

For example, if I had a formula that just added 12 to the value in A1, I could
use:
=A1+12

But if I wanted to make the cell look empty until something is put into A1, I
could use one of these:

=if(a1="","",a1+12)
or
=if(isnumber(a1),a1+12,"")



carspjcars wrote:

I'm trying to set up a template in Excel. I wish to keep the formula but
delete contents, so i can us the same sheet again.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,942
Default keep formula delete contents

hi
do you mean that you want to keep the formula AND column headers(other
headers too) but just delete the data that the fomulas key on??
if so.......
A macro might be best for this.
make a list of all the cells you want to delete from your template.
this list would exclude cells that contained formulas or headers.
the macro would look something like this....

private sub DeleteJunk()
Range("B3:B20,C9:C20, D12,D14,E3:G3, E14, E16").ClearContents
end sub

I made up the ranges above so you would obviously replace all the cell
references with your own from your list.
you would list the delete cells as ranges such as (for example) B3:B20 or
E3:G3 plus all the individual cells like d12, D14 ect seperating each
reference with a comma.
since it is a template, you could drop a command button on the sheet and
attach the macro to the button.
this way, you fill in the template, save or print, then click the delete
button.
template is ready for the next round.

at least that is what i would do.
Regards
FSt1

"carspjcars" wrote:

I'm trying to set up a template in Excel. I wish to keep the formula but
delete contents, so i can us the same sheet again.

  #4   Report Post  
Senior Member
 
Location: Hyderabad
Posts: 237
Thumbs up

Quote:
Originally Posted by FSt1 View Post
hi
do you mean that you want to keep the formula AND column headers(other
headers too) but just delete the data that the fomulas key on??
if so.......
A macro might be best for this.
make a list of all the cells you want to delete from your template.
this list would exclude cells that contained formulas or headers.
the macro would look something like this....

private sub DeleteJunk()
Range("B3:B20,C9:C20, D12,D14,E3:G3, E14, E16").ClearContents
end sub

I made up the ranges above so you would obviously replace all the cell
references with your own from your list.
you would list the delete cells as ranges such as (for example) B3:B20 or
E3:G3 plus all the individual cells like d12, D14 ect seperating each
reference with a comma.
since it is a template, you could drop a command button on the sheet and
attach the macro to the button.
this way, you fill in the template, save or print, then click the delete
button.
template is ready for the next round.

at least that is what i would do.
Regards
FSt1

"carspjcars" wrote:

I'm trying to set up a template in Excel. I wish to keep the formula but
delete contents, so i can us the same sheet again.
Hi,

keep the formulae in the workbook undeleted and use conditional formatting to aviod #errors, #values visible in the workbook

step1: place the cursor in A1
step2: Ctlr A
Step3: Choose conditional formating
Step4: Use formaulae =ISERROR(A1)
step5: show formating Null (fore ground white and backgroud white)

Thanks
Bala
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default keep formula delete contents

F5SpecialConstantsOK

EditDelete

Uncheck "Text" if you want to keep data like titles.


Gord Dibben MS Excel MVP

On Mon, 3 May 2010 16:19:01 -0700, carspjcars
wrote:

I'm trying to set up a template in Excel. I wish to keep the formula but
delete contents, so i can us the same sheet again.


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
Delete the contents of a cell if it contains #DIV/0! Automaticall. GoodyA10 Excel Discussion (Misc queries) 4 April 27th 10 03:45 PM
delete contents of cell RDC Excel Discussion (Misc queries) 1 January 21st 09 04:13 PM
Delete cell contents Rob[_4_] Excel Discussion (Misc queries) 7 April 10th 07 12:34 PM
Delete contents of cells mikespeck Excel Worksheet Functions 3 July 27th 06 03:16 PM
How to Delete Contents of D2 if B2 = "SD" StarBoy2000 New Users to Excel 5 July 21st 05 06:46 PM


All times are GMT +1. The time now is 07:21 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"