Clear/Delete Zeros in Specified Range

  • Re: select "0's"


    zotee98,


    Is that a zero or an oh?
    Does the cell contain anything other than those round things?
    What do you want to do with them after you select them?


    Jim

  • Re: select "0's"


    i want to delete the zeros. is there perhaps a better way? i need the cells to be completly blank.

  • Re: select "0's"


    Here is a macro to select them (your original question).


    To delete the zeros, change the "AllZeros.Select" to "AllZeros.Clear"

  • Re: select "0's"


    But if you just want to clear the zeros, use:


    NOTE: (EDIT) Using simply

    Code
    If c = 0 Then c.Clear

    will also clear the zeros, but it also will clear the formatting from any empty cells. If you want to keep the formatting (including formatting in cells with zeros in them, then use

    Code
    If c = 0 Then c.ClearContents
  • Re: select "0's"


    Another choice:


    Code
    Sub Macro3()
        Columns("H:J").Select
        Selection.Find(What:="0", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
            :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
            False, SearchFormat:=False).Clear
        Selection.FindNext(After:=ActiveCell).Clear
    End Sub
  • Re: select "0's"


    Leave the zeros in the cells as empty cells also have a value of zero. Hide them via Tools>Options>View - Zero Values or use a Custom Number Format to hide them on a cell-by-cell basis.


    Or, if you really wnat to, try simply using Edit>Replace and Replace 0 with nothing (leave replace with blank.)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!