Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I make a cell truly empty using an "If" statement?

If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default How do I make a cell truly empty using an "If" statement?

Hi ALHR,

With VBA, try,

Range("A1").ClearContents

If, however, your intention is to work
from Excel , it is not possible for a
formula to '"empty" a cell; at most,
a formula can make the cell seem empty.


---
Regards.
Norman
"ALHR" wrote in message
...
If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

Thank you


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How do I make a cell truly empty using an "If" statement?

Try ActiveCell.Clear

"ALHR" wrote:

If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

Thank you

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I make a cell truly empty using an "If" statement?

Thanks for your response. To be a little more clear, what I am trying to do
is assign a group of cells a value if a certain condition is true, and leave
them empty if false. What I have done in the past is used "" in my "if"
statement for the false condition. The problem is that while the cell
appears to be empty, Excel treats it as though it contains text.


"Norman Jones" wrote:

Hi ALHR,

With VBA, try,

Range("A1").ClearContents

If, however, your intention is to work
from Excel , it is not possible for a
formula to '"empty" a cell; at most,
a formula can make the cell seem empty.


---
Regards.
Norman
"ALHR" wrote in message
...
If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

Thank you


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How do I make a cell truly empty using an "If" statement?

I think that if you are going to use formulas to test the cells, then the
best approach would be to test for null strings instead of ISEMPTY.

If ActiveCell < "" Then

Or

If ActiveCell = "" Then

Because if the cell is empty, then Excel will treat it like "". But that
would not solve the CountA dilemma.

"ALHR" wrote:

Thanks for your response. To be a little more clear, what I am trying to do
is assign a group of cells a value if a certain condition is true, and leave
them empty if false. What I have done in the past is used "" in my "if"
statement for the false condition. The problem is that while the cell
appears to be empty, Excel treats it as though it contains text.


"Norman Jones" wrote:

Hi ALHR,

With VBA, try,

Range("A1").ClearContents

If, however, your intention is to work
from Excel , it is not possible for a
formula to '"empty" a cell; at most,
a formula can make the cell seem empty.


---
Regards.
Norman
"ALHR" wrote in message
...
If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

Thank you




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default How do I make a cell truly empty using an "If" statement?

What about copying a contents of an empty cell to the one you would
like to clear?
For this purpose assign some cell that you will always keep clear.

It's an idea only. I'm not too much advanced guy in Exel.

Regards,
Greg.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How do I make a cell truly empty using an "If" statement?

Thanks for your response. Yeah, the probem is with the CountA. Also, when I
chart the data, Excel treats "" as 0, so it actually puts points on the chart
as Y=0 rather than just excluding them. It does this even when I select
"Plot empty cells" - "not plotted," indicating again that it is not treating
these as empty cells. Oddly, as you noted, the ISEMPTY function does treat
them as empty.

"JLGWhiz" wrote:

I think that if you are going to use formulas to test the cells, then the
best approach would be to test for null strings instead of ISEMPTY.

If ActiveCell < "" Then

Or

If ActiveCell = "" Then

Because if the cell is empty, then Excel will treat it like "". But that
would not solve the CountA dilemma.

"ALHR" wrote:

Thanks for your response. To be a little more clear, what I am trying to do
is assign a group of cells a value if a certain condition is true, and leave
them empty if false. What I have done in the past is used "" in my "if"
statement for the false condition. The problem is that while the cell
appears to be empty, Excel treats it as though it contains text.


"Norman Jones" wrote:

Hi ALHR,

With VBA, try,

Range("A1").ClearContents

If, however, your intention is to work
from Excel , it is not possible for a
formula to '"empty" a cell; at most,
a formula can make the cell seem empty.


---
Regards.
Norman
"ALHR" wrote in message
...
If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

Thank you


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I make a cell truly empty using an "If" statement?

You can try using na() instead of "" in your if statement.

i.e.:

if(condition,na(), false)

instead of

if(condition, "", false)

This won't make the cell appear empty, BUT it will allow you to make a plot
without these values showing up!


"ALHR" wrote:

Thanks for your response. Yeah, the probem is with the CountA. Also, when I
chart the data, Excel treats "" as 0, so it actually puts points on the chart
as Y=0 rather than just excluding them. It does this even when I select
"Plot empty cells" - "not plotted," indicating again that it is not treating
these as empty cells. Oddly, as you noted, the ISEMPTY function does treat
them as empty.

"JLGWhiz" wrote:

I think that if you are going to use formulas to test the cells, then the
best approach would be to test for null strings instead of ISEMPTY.

If ActiveCell < "" Then

Or

If ActiveCell = "" Then

Because if the cell is empty, then Excel will treat it like "". But that
would not solve the CountA dilemma.

"ALHR" wrote:

Thanks for your response. To be a little more clear, what I am trying to do
is assign a group of cells a value if a certain condition is true, and leave
them empty if false. What I have done in the past is used "" in my "if"
statement for the false condition. The problem is that while the cell
appears to be empty, Excel treats it as though it contains text.


"Norman Jones" wrote:

Hi ALHR,

With VBA, try,

Range("A1").ClearContents

If, however, your intention is to work
from Excel , it is not possible for a
formula to '"empty" a cell; at most,
a formula can make the cell seem empty.


---
Regards.
Norman
"ALHR" wrote in message
...
If the condition is false, I want the cell to be empty. When I use ""
counta() and other functions treat the cell as text.

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
Empty a cell if the values equal to "IN" , "MC" or "PP" YHT Excel Programming 1 December 28th 07 06:59 AM
delete rows if cell in row contains "a" or "o" or empty bartman1980 Excel Programming 2 November 4th 07 08:20 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM
how can I make an excel cell "mark" or "unmark" when clicked on? Rick Excel Discussion (Misc queries) 6 January 8th 06 10:15 PM
How can I make cell A1 a "Y" or "N" depending upon cell A2's font color? Please help. [email protected] Excel Programming 1 October 16th 03 08:32 PM


All times are GMT +1. The time now is 12:48 AM.

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"