Counting blanks
Posted by rob on January 17, 2002 7:06 AM
I need a statement that counts blank cells and returns 0 if there is no blank spaces. I've tried:-
Selection.SpecialCells(xlCellTypeBlanks).count
But if there are no blank spaces it return error 1004 run time error. So if possible I'd like a one line statement that return 0 instead of an error.
Any help appreciated. The emphasis on this is to keep the code as short as possible.