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 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| Sub attends()
Dim f As Integer
Dim Cellule As Range
Dim Plage_C As Range, Plage_D As Range
Heure_Actuelle = Timer
Randomize
Nb_Seconde = Int((2400 - 1200 + 1) * Rnd + 1200)
Do
If Not Time = "13:00:00" Then
If Int(Timer - Heure_Actuelle) Mod Nb_Seconde = 0 Then
f = FreeFile
Open "C:\30minutes.txt" For Output As #f
For Each Cellule In Range("A1:A9")
Print #f, Cellule.Text
Next
Close f
End If
Else
If Int(Timer - Heure_Actuelle) Mod Nb_Seconde = 0 Then
f = FreeFile
Open "C:\30minutes.txt" For Output As #f
For Each Cellule In Range("A1:A9")
Print #f, Cellule.Text
Next
Close f
End If
Set Plage_C = Range("L10:O14")
Set Plage_D = Range("L15:O19")
Plage_D.Value = Plage_C.Value
Set Plage_C = Nothing
Set Plage_D = Nothing
End If
DoEvents
Loop
End Sub |
Partager