'help..this is far from working..all I do is get in a loop
'what I am trying to do is create a random number between 1 and 47
'have no duplicates, sort, paste to text boxes.
'just a dumb lotto generation scheme
'

Dim sArray(1 To 7) ' total numbers selected
Dim ICheck7(1 To 47) ' numbers range from 1 to 47


'load the iCheck7 array with the 47 available numbers

Dim a
For a = 1 To 47
ICheck7(a) = a
Next a

Dim i
Dim iCounter As Integer 'counter to end loop

Randomize

For i = 1 To 7

'must be a number between 1 and 47
sArray(i) = Int((47 - 1 + 1) * Rnd + 1)

'start here again if a duplicate is found

Again:

'do until I have all 7 numbers compared and placed in array

Do While iCounter < 8
'check the current sArray indexed number agains the icheck7 array
' numbers (1 to 47)

For a = 1 To 47
If sArray(i) = ICheck7(a) Then

' if a number matches 1 to 47 then keep the number
'change th iCheck7 number to 0 so it can't be matched again
'increment the counter

sArray(i) = sArray(i)
ICheck7(a) = "0"
iCounter = iCounter + iCounter

Else
'if no match is found I already have the number so create a new one
'and then run trhought the check again...do until I get a good number

Randomize
sArray(i) = Int((47 - 1 + 1) * Rnd + 1)
End If

GoTo Again:
Next a
Loop

Next i
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'from here down is not a problem
'sort the arrays

Call BubbleSortNumbers(sArray)

Text7.Text = sArray(1)
Text8.Text = sArray(2)
Text9.Text = sArray(3)
Text10.Text = sArray(4)
Text11.Text = sArray(5)
Text12.Text = sArray(6)
Text13.Text = sArray(7)