Hello,
what is the equivalent of continue of C in VBA?
I currently have a code which checks for prime numbers:
However, I keep getting an error "Compile Error: Next without for"
The red highlighted line seems to be the trouble.
Thank you in advance,
kpark
what is the equivalent of continue of C in VBA?
I currently have a code which checks for prime numbers:
Rich (BB code):
Function checkPrime(a As Double) As Boolean
For n = 2 To Int(Sqr(a))
If (n Mod 2 = 0 And n <> 2) Then
Next n
ElseIf (a Mod n = 0) Then
checkPrime = False
Exit Function
End If
Next n
checkPrime = True
End Function
However, I keep getting an error "Compile Error: Next without for"
The red highlighted line seems to be the trouble.
Thank you in advance,
kpark