Test cells within Range("S16:S19) are NOT Numbers
Change application.countA to application.count
Excel's help (Not VBA's) will explain the difference between the two.
Personally, I like myrng.cells.count instead of myrng.count--just because I
think the first is more "self-documenting". But both will count the number of
cells in that range.
CRayF wrote:
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
--
Dave Peterson
|