Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Simple code to find the empty cells in a range and cells with number

I want to find out how many cells in a given range are empty
Also, since my range can only have numbers in them, it should
also check that the non empty cells do not contain text (only
numbers)
Help to do this in the simplest code possible.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 464
Default Simple code to find the empty cells in a range and cells with number

Use SpecialCell Method
http://www.ozgrid.com/VBA/special-cells.htm

Some other FUNCTIONS
COUNT
COUNTBLANK
COUNTA
COUNTIF



--
Regards
Dave Hawley
www.ozgrid.com
"Subodh" wrote in message
...
I want to find out how many cells in a given range are empty
Also, since my range can only have numbers in them, it should
also check that the non empty cells do not contain text (only
numbers)
Help to do this in the simplest code possible.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Simple code to find the empty cells in a range and cells with number

You should be able to make use of these...

NumberOfEmptyCells = WorksheetFunction.CountBlank(Selection)

NumberOfTextCells = WorksheetFunction.CountIf(Selection, "*")

You can substitute and actual range for the Selection range which I used in
my examples; for instance....

NumberOfEmptyCells = WorksheetFunction.CountBlank(Range("A1:H9"))

NumberOfTextCells = WorksheetFunction.CountIf(Range("A1:H9"), "*")

--
Rick (MVP - Excel)



"Subodh" wrote in message
...
I want to find out how many cells in a given range are empty
Also, since my range can only have numbers in them, it should
also check that the non empty cells do not contain text (only
numbers)
Help to do this in the simplest code possible.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
clearing values of cells in named range(s) so the cells are empty BRC[_2_] Excel Programming 1 January 10th 10 06:54 AM
find empty cells in a column then append row that empty cell is in vbnewbie Excel Programming 9 January 29th 09 09:27 AM
Excel- find the last filled cells in column with empty cells [email protected] Excel Programming 1 September 28th 07 12:20 AM
Count Empty Cells in Range After Cells with Data David Excel Programming 16 September 17th 06 03:03 PM
To find number of non-empty cells across columns Mark Stephens[_3_] Excel Programming 1 July 2nd 05 02:23 AM


All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"