ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SELECTIVE DELETE (https://www.excelbanter.com/excel-programming/364430-selective-delete.html)

[email protected]

SELECTIVE DELETE
 
I would like to delete all cells in row M with value 0,

However, all cells in row M contain the formula:

=IF(L8=2004, 2006, 0)

because I used this formula to produce a value of 2006 in M8 where L8 =
2004

I need all the cells that do not read 2006 to be completely blank
(contain no formula or value).


alina b.

SELECTIVE DELETE
 
try this

Sub deleteZero()

For x = 1 To 65536
If Cells(x, 13).Value = 0 Then Cells(x, 13).Value = ""
Next

End Sub

wrote:
I would like to delete all cells in row M with value 0,

However, all cells in row M contain the formula:

=IF(L8=2004, 2006, 0)

because I used this formula to produce a value of 2006 in M8 where L8 =
2004

I need all the cells that do not read 2006 to be completely blank
(contain no formula or value).



Dave Peterson

SELECTIVE DELETE
 
Can you convert all the formulas to values?

If yes, then you could
edit|replace
what: 0
with: (leave blank)
replace all
(and check "match entire cell contents")

====
If you can't convert all the formulas to values, you could use a different
formula--like:

=if(l8=2004,2006,na())

Then select column M
edit|goto|Special
Check formulas and errors

Then hit the delete key to clear those cells.

Be careful if there are other errors in column L.

wrote:

I would like to delete all cells in row M with value 0,

However, all cells in row M contain the formula:

=IF(L8=2004, 2006, 0)

because I used this formula to produce a value of 2006 in M8 where L8 =
2004

I need all the cells that do not read 2006 to be completely blank
(contain no formula or value).


--

Dave Peterson


All times are GMT +1. The time now is 06:41 PM.

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