1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Do Until Range("T7") <> "" Or Arret = True 'conditionne la boucle jusqu'à la dernière colonne de ton tableau
If i > 15 Then Cells(7, i - 1).Value = Range("B1") 'mettre la valeur de B1 dans les cellule precedente
Cells(7, i).Value = Range("B1").Value 'mets ta valeurs dans la cellule de ton tableau
If Range("O7") <> "" Then
Range("O8").FormulaR1C1 = "=INDEX($H13:$H1048576;ARRONDI.SUP(ALEA()*NBVAL($H13:$H1048576);0);1)"
End If
If Range("P7") <> "" Then
Range("P8").FormulaLocal = "=INDEX($H13:$H1048576;ARRONDI.SUP(ALEA()*NBVAL($H13:$H1048576);0);1)"
End If
If Range("Q7") <> "" Then
Range("Q8").FormulaLocal = "=INDEX($H13:$H1048576;ARRONDI.SUP(ALEA()*NBVAL($H13:$H1048576);0);1)"
End If
If Range("R7") <> "" Then
Range("R8").FormulaLocal = "=INDEX($H13:$H1048576;ARRONDI.SUP(ALEA()*NBVAL($H13:$H1048576);0);1)"
End If
If Range("S7") <> "" Then
Range("S8").FormulaLocal = "=INDEX($H13:$H1048576;ARRONDI.SUP(ALEA()*NBVAL($H13:$H1048576);0);1)"
End If
If Range("T7") <> "" Then
Range("T8").FormulaLocal = "=INDEX($H13:$H1048576;ARRONDI.SUP(ALEA()*NBVAL($H13:$H1048576);0);1)"
End If
i = i + 1 'prochaine colonne
Application.Wait Time + TimeSerial(0, 0, 2) 'attends 10 sec
DoEvents
Loop |
Partager