-
heeelpppppppppp
what would the interface look like for this code?
Private Sub Form_Load()
Option Explicit
Dim i As Integer
Dim MyRecord(1 To 7, 1 To 1) As Long
'Array 1 to 5 are the candidates
'Array 6 is dummy votes
'Array 7 is total votes
Randomize
Dim Vote As Integer
For i = 1 To 10
'Set caption to random a randome number from 1 to 10
Vote = Int(10 * Rnd) + 1
If Vote <= 5 Then
MyRecord(Vote, 1) = MyRecord(Vote, 1) + 1
Else
MyRecord(6, 1) = MyRecord(6, 1) + 1
End If
MyRecord(7, 1) = MyRecord(7, 1) + 1
Next
For i = 1 To 7
Debug.Print MyRecord(i, 1)
Next
End Sub
End Sub
would be appreaciated :D ! I really need help!!
-
Re: heeelpppppppppp
Hi mematoots,
welcome to the forum :wave:
By interface u mean the form outlook?
Anyway the code won't work. U need to correct it first. (Option Explicit inside a sub, 2 End Sub's etc.)
Pradeep :)
-
Re: heeelpppppppppp
This was the firs run:
Second Run: (see the problem, yet?)
Last time:
-
Re: heeelpppppppppp
Here's the scoop.
1) Take Option Explicit out of the the sub and put it in the General Declarations which is the very top of the code window.
2) Use [Highlight=VB] tags around vb code
3) Use sensible thread titles please. Using thread titles like "Help" or "Noobie" or "Problem with my code", etc. is not good and will tend to turn people away. But using titles like "Command Button not working", or "Dividing without dividing", etc., is more specific and breif and will get you more help.