hello
the following function should calculate how many numbers in a given range
are prime numbers- they can be divided only in 1 or themselfs and return
an integer without a residual.
[vba]Function isprimer(lowernumber As Integer, highernumber As Integer)
Dim i As Integer
For i = lowernumber To highernumber
If Not i Mod 2 = 0 Or Not i Mod 3 = 0 Or Not i Mod 5 = 0 Or Not i Mod 7 = 0 Then
isprimer = i + 1
End If
Next
End Function[/vba]
thanks