Zero in blank fields

  • I am trying to put a zero in all numeric fields within a data set. There are both number fields and text fields. Some of the cells have no data in them and I would like to replace those cells with the number "0". Any ideas on how to complete that?


    Here is the way that I thought I should go, but I have no clue on where to go exactly.

    Code
    1. Selection.SpecialCells(xlCellTypeBlanks).Select


    Thank you in advance!

  • Re: Zero in blank fields


    Hi,


    You could also look at a loop using =ISBLANK(your cell)= TRUE then let your cell = 0


    You'd have to support this with the way the cells are formatted too.


    I hope this helps but apologise in advance, I am not sure I've got a full grip on your query.


    John

  • Re: Zero in blank fields


    Try Edit>Goto... and choose blanks.


    Then in the formula bar put a 0 and press CTRL+ENTER.


    Recorded VBA code.

    Code
    1. Selection.SpecialCells(xlCellTypeBlanks).Select
    2. Selection.FormulaR1C1 = "0"

    Boo!:yikes: