ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clearing a cell (https://www.excelbanter.com/excel-programming/359969-clearing-cell.html)

news.microsoft.com[_10_]

Clearing a cell
 
How can you clear a cell in a formula? I want something similar to:

IF(<SomeCondition,"Text","")

But if I use that, and then try to count non-blank cells, the cells where "" was stored are not considered blank. How can I actually make the cell blank in that formula? Thanks.

Jerry

Gary''s Student

Clearing a cell
 
Putting any formula in A1 makes it non-blank.

That is =ISBLANK(A1) will return FALSE

You need VBA:

if {condition} then
CELLS(1,1) = "TEXT"
else
CELLS(1,1).Clear
endif
--
Gary's Student


"news.microsoft.com" wrote:

How can you clear a cell in a formula? I want something similar to:

IF(<SomeCondition,"Text","")

But if I use that, and then try to count non-blank cells, the cells where "" was stored are not considered blank. How can I actually make the cell blank in that formula? Thanks



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com