the following code is typed by an expert as an answer in my quetion titled "Randomize" it is a right answer :
Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Dim MyValue As Integer
Dim array_temp(6) As Integer
Dim Response As VbMsgBoxResult
i = 1
While i <= 6
Randomize ' Initialize random-number generator.
MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 and 6.
For j = 1 To 6
If array_temp(j) <> 0 Then
If MyValue = array_temp(j) Then
array_temp(j) = MyValue
Response = MsgBox("Roll again? ", vbYesNo)
i = i + 1
If Response = vbNo Then
i = 100
this code succeed to let the computer choose a number between 1 and 6 once not more than one time.
for example (3,6,5,4,2,1) not (2,2,5,6,3,5)
now i ask how can i change this code to put some conditions in distributing these numbers , for example:
4 comes in the first part , 5 in the second part , 1 in the end . then what is the way to put conditions.