Fill in the blanks!!

G

Guest

Hi All,

I have a range of cells (i.e. A1: D5), some of which contain values and
others that are blank.

I want to create a piece of code that looks in each cell of the range. If
the cell is blank, then insert a 0, and if the cell contains a value then
ignore it and move on to the next cell.

Can anyone help at all?

Thanks,

Pinda.
 
R

Ron de Bruin

Try this

On Error Resume Next
Range("A1:D5").SpecialCells(xlCellTypeBlanks).Value = 0
On Error GoTo 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top