filmov
tv
how to generate random numbers with vba excel

Показать описание
This random number game can be modified in such a way as for other purposes, for scripts please copy below description
--------------------------------------------------------------
Public Hentikan As Date
Function AcakAngka(r As Range, iMin As Long, iMax As Long) As Integer
Dim i As Long
Dim j As Long
For i = 1 To r.Rows.Count
For j = 1 To r.Columns.Count
r(i, j) = Int(iMax - iMin + 1) * Rnd + iMin
Next j
Next i
End Function
Sub Main()
Hentikan = Now + TimeValue("0:0:10")
Do While Now X Hentikan
AcakAngka Range("B1:E10"), 1, 9
DoEvents
Loop
End Sub
Sub berhenti()
Hentikan = Now()
End Sub
Private Sub Workbook_Activate()
ramdomize
Main
End Sub
Not:
for code x in the Do While Now (x) script, please replace it with open brackets
--------------------------------------------------------------
Public Hentikan As Date
Function AcakAngka(r As Range, iMin As Long, iMax As Long) As Integer
Dim i As Long
Dim j As Long
For i = 1 To r.Rows.Count
For j = 1 To r.Columns.Count
r(i, j) = Int(iMax - iMin + 1) * Rnd + iMin
Next j
Next i
End Function
Sub Main()
Hentikan = Now + TimeValue("0:0:10")
Do While Now X Hentikan
AcakAngka Range("B1:E10"), 1, 9
DoEvents
Loop
End Sub
Sub berhenti()
Hentikan = Now()
End Sub
Private Sub Workbook_Activate()
ramdomize
Main
End Sub
Not:
for code x in the Do While Now (x) script, please replace it with open brackets