View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Combine IsNumeric & CountA in single If statement

Hi Howard,

Am Sat, 2 Aug 2014 23:01:11 -0700 (PDT) schrieb L. Howard:

With the IsNumeric test, it returns "Yes" for a blank cell otherwise works OK.
How to not see blank as IsNumeric?


if you only want to check c then:

For Each c In aRng
If Len(c) 0 And IsNumeric(c) Then
'Do something
End If
Next

If you want to check the resized range also:

For Each c In aRng
If WorksheetFunction.CountA(c.Resize(, 8)) = 8 _
And IsNumeric(c) Then
'Do something
End If
Next


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional