Can someone help me out, I need code for a program that uses sieve of erasothenes for #s 2---2000000000. Must use an array type boolean to determine the primes and display them in text box on a seperate form. My code consists of this now:

Option Explicit
Private Primes() As Long
Private Function GetMax() As Long
GetMax = CLng(Text1.Text)
Exit Function
GetMax = 0
Err.Raise -1, "GetMax", "Not a number"
End Function

Private Function IsPrime(ByVal Number As Long)

IsPrime = False
Dim I As Long
For I = LBound(Primes) To UBound(Primes)

Call UpdateStatus(Number, Primes(I))
If (Number Mod Primes(I) = 0) Then Exit Function
If (Primes(I) >= Sqr(Number)) Then Exit For
IsPrime = True
End Function

Private Sub UpdateStatus(ByVal Number As Long, ByVal Prime As Long)
If (Check1.Value = 0) Then Exit Sub
StatusBar1.SimpleText = "Testing " & Number & _
" is divisible by Prime(" & Prime & ") = " & _
(Number Mod Prime = 0)
End Sub

Private Sub BuildPrimes(ByVal Max As Long)

If (Max < 3) Then Exit Sub
Dim I As Long

For I = 2 To Max
If (IsPrime(I)) Then
ReDim Preserve Primes(UBound(Primes) + 1) As Long
Primes(UBound(Primes)) = I
End If

End Sub

Private Sub Command1_Click()
On Error GoTo Handler

Dim Value As Variant
BuildPrimes (GetMax())

For Each Value In Primes
List1.AddItem (Value)

Exit Sub
MsgBox Err.Description, vbCritical, Err.Source
End Sub

Private Sub Initialize()
ReDim Primes(0)
Primes(0) = 2
End Sub

Private Sub Form_Load()
End Sub