Replacing blank cells with zeros

G

Guest

Hello, I have a an area of a spreadsheet 15 columns wide and 256 rows deep.
Some of the cells are populated with numbers but some are blank. I would like
to replace blank cells with zeros. What is the most efficient VBA method of
achieving that.
Thank you
 
N

Nick Hodge

You could use code like that below

Sub InsertZeroInBlank()
Dim myRng As Range
Set myRng = Range("A1:O256")
myRng.SpecialCells(xlCellTypeBlanks).Value = 0
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 

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