ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replacing blank cells with zeros (https://www.excelbanter.com/excel-programming/328973-replacing-blank-cells-zeros.html)

Ben

Replacing blank cells with zeros
 
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

Nick Hodge

Replacing blank cells with zeros
 
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
HIS

"Ben" wrote in message
...
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





All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com