hello I have written a little program below and it works as intended. How ever, I am completely stuck on the next step.
Option Explicit
Sub Example()
Dim Ramdom As Single
Dim i As Integer
Dim j As Integer
For j = 1 To 10
For i = 1 To 7
Ramdom = Rnd()
' generates a random number
If Ramdom < 0.5 Then _
Cells(i, j).Value = 0 _
' if the random number is < 0.5 a "0" results
Else: Cells(i, j).Value = 1
' if the random number is > 0.5 a "1" results
Next i
Next j
End Sub
The program (try it if you want) produces a 7 x 10 table of numbers (0's and 1's).
I would however like to put in an element whereby the 0 represents fail and 1 a pass.
If there is a 0 I would like the next two numbers to be 0 (regardless of what the random number generator gives).
I have tried changing the value of the counters (i & j) but always get bad results
Option Explicit
Sub Example()
Dim Ramdom As Single
Dim i As Integer
Dim j As Integer
For j = 1 To 10
For i = 1 To 7
Ramdom = Rnd()
' generates a random number
If Ramdom < 0.5 Then _
Cells(i, j).Value = 0 _
' if the random number is < 0.5 a "0" results
Else: Cells(i, j).Value = 1
' if the random number is > 0.5 a "1" results
Next i
Next j
End Sub
The program (try it if you want) produces a 7 x 10 table of numbers (0's and 1's).
I would however like to put in an element whereby the 0 represents fail and 1 a pass.
If there is a 0 I would like the next two numbers to be 0 (regardless of what the random number generator gives).
I have tried changing the value of the counters (i & j) but always get bad results