Clear formula cells that return 0 value

Nandy7071

New Member
Joined
Jun 27, 2019
Messages
16
Is there a way to clear all cells which have formulas but return 0 value? Im trying to reduce the file size of my spreadsheet.

Ive seen some suggestions to use "Find and Replace" and replace all cells from "0" to "" but Excel doesn't allow find and replace on values, only formulas.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Gulp! That is a lot of formulas.




By "highlighted cells" do you mean cells that have been selected? If so, here is my code modified to only look at cells within the current selection (the only change I made from my previous code is highlighted in red)...
Code:
Sub DeleteFormulaZeros()
  Dim Ar As Range, Cell As Range
  Application.ScreenUpdating = False
  On Error Resume Next
  For Each Ar In [B][COLOR="#FF0000"]Selection[/COLOR][/B].SpecialCells(xlFormulas).Areas
    For Each Cell In Ar
      If Cell.Value = 0 Then Cell.Clear
    Next
  Next
  On Error GoTo 0
  Application.ScreenUpdating = True
End Sub
Is there a way to do this for formulas that evaluate in an empty cell as opposed to a 0?
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top