View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
CRayF CRayF is offline
external usenet poster
 
Posts: 115
Default Test cells within Range("S16:S19) are NOT Numbers

Way new at this and Im not sure how to add this within my loop...

My current code this. It loops but for this eample lets assume j=11...
I am currently using the Application.CountA.Range testing Range.Count but
this seems not to work, if I change it to test looing for numbers I know that
will...
So, How could I augment this stamtment using your sugestion for testing for
numners?

If Target.Address = "$S$4" And ActiveSheet.Name < _
srcBettingTemplateWs.Name Then
srcBettingTemplateWs.Unprotect
If Application.CountA(Range("S" & j + 5 & ":S" & j + 8)) < _
Range("S" & j + 5 & ":S" & j + 8).Count Then
'At least one of your racers are missing.
'code here
Else
'No racers are missing.
End If
End If

"Dave Peterson" wrote:

dim myRng as range
with activesheet
set myrng = .range("s16:S19")
end with

if application.count(myrng) = myrng.cells.count then
'all numbers
else
'not all numbers
end if