Monday 20 May 2013

How to count blank cells in given range in Excel using VBA Macro


Below Example will count all blank cells from given range in the worksheets

VBA Macro Code / Syntax :



n = Range("h3:h30").Cells.SpecialCells(xlCellTypeBlanks).Count
MsgBox n           'Print all blank cells

Here xlCellTypeBlanks means that cell is blank.

 
n = Range("h3:h30").Cells.SpecialCells(xlCellTypeConstants).Count
MsgBox n            ' Print all cells with constant values not formulas

This is how we can find out the blank cells in Excel Macro

1 comment:

Popular Posts

Search This Blog