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

How do you clear the contents of a cell but keep the formula? Also, how do I
program that if answer is 0 then leave cell blank instead of putting in the
zeros? Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clear contents/keep formula

You don't. The formula produces a result and that is what is displayed.
You could possibly change all the font colors to match the background color
or you could adjust all your formulas to do something like this

=if(A1<"",currentformula,"")

then if you cleared A1, all cells would look blank.

You could use a similar construct to appear blank if the formula returns a
zero.

=if(A1<"",if(currentformula=0,"",currentformula), "")


--
Regards,
Tom Ogilvy

"Flopp2" wrote in message
...
How do you clear the contents of a cell but keep the formula? Also, how

do I
program that if answer is 0 then leave cell blank instead of putting in

the
zeros? Thank you



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clear contents/keep formula

for the zero appears blank question, a better approach might be to do
Tools=Options=View and uncheck Zero Values.

--
Regards,
Tom Ogilvy


"Flopp2" wrote in message
...
How do you clear the contents of a cell but keep the formula? Also, how

do I
program that if answer is 0 then leave cell blank instead of putting in

the
zeros? Thank you



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Clear contents/keep formula

Maybe I have been asking the wrong question as you have offered me plenty of
help. "vba code doesn't work". What this guy is asking is kind of what I
want to do. I have cell references to another worksheet which if there is no
data then it displays 0. Your idea of changing the background color to match
fonts or visa versa might be the ticket. You see the length of my worksheet
keeps changing depending of how much data is being transferred in and all I
basically wanted to do is clean up the cosmetics of the worksheet. Is this
your suggestion for me?

"Tom Ogilvy" wrote:

You don't. The formula produces a result and that is what is displayed.
You could possibly change all the font colors to match the background color
or you could adjust all your formulas to do something like this

=if(A1<"",currentformula,"")

then if you cleared A1, all cells would look blank.

You could use a similar construct to appear blank if the formula returns a
zero.

=if(A1<"",if(currentformula=0,"",currentformula), "")


--
Regards,
Tom Ogilvy

"Flopp2" wrote in message
...
How do you clear the contents of a cell but keep the formula? Also, how

do I
program that if answer is 0 then leave cell blank instead of putting in

the
zeros? Thank you




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
Clear Contents gibbylinks Setting up and Configuration of Excel 5 October 12th 09 05:04 PM
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
How do I clear a cell contents but not the formula behind it SliderSteve Excel Discussion (Misc queries) 5 November 19th 07 11:33 PM
Is there a formula to clear the contents of a specific cell? Bob Smith Excel Worksheet Functions 2 December 9th 06 07:41 PM
Clear Contents But Not Formula Gancom3 Excel Discussion (Misc queries) 2 February 1st 05 11:30 PM


All times are GMT +1. The time now is 03:00 AM.

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"