Hi,
When I run the following code:
Private Sub btnClickMe_Click()
Dim intrandom As Integer
Dim index
Dim person
Dim match As Boolean
Dim personx
Dim persony
Dim n
Dim birthday()
Dim counter
match = False
ReDim Preserve birthday(23)
intrandom = (Rnd * 364) + 1
Randomize
counter = 0
For n = 1 To 100
For persony = 1 To 23
birthday(person) = intrandom
Next
match = False
For personx = 1 To 22
For persony = personx + 1
If birthday(personx) = birthday(persony) Then
match = True
End If
Next
Next
If match = True Then
counter = counter + 1
End If
For index = 0 To UBound(birthday)
lblResults.Caption = lblResults.Caption & birthday(index) & vbCrLf
Next
Next
End Sub
I get compile error:syntax error
When I have in read is what the problem might be.
This is the old birthday problem.
Thanks.