Extração de número de
Excel VBA - Extração de número de loto , loteria
‘=AleatórioLoto(1;49;6)
Function AleatorioLoto(Botao As Integer, Top As Integer, Amount As Integer)
Dim iNum As String
Dim strNum As String
Dim i As Integer
Application.Volatile
iNum = Int((Top - Botao + 1) * Rnd + Botao)
For i = 1 To Amount
strNum = Trim(strNum & ” ” & iNum)
Do Until InStr(1, strNum, iNum) = 0
iNum = Int((Top - Botao + 1) * Rnd + Botao)
Loop
Next i
AleatorioLoto = strNum
End Function
‘———————————–‘
http://www.saberexcel.com
O site das 15.000 Macros, funcoes e formulas, planilhas, downloads, apostilas
Nenhum comentário:
Postar um comentário