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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| Sub CommandButton1_Click()
Dim i As Integer
Dim j As Integer
Dim bm As New cBenchmark
bm.TrackByName "Initialisations"
For i = 1 To 50
ActiveSheet.Cells(5, 4).Value = i
ActiveSheet.Cells(5, 5).Value = ChrW(&H2191)
For j = 1 To 10
ActiveSheet.Cells(6, 4).Value = j
If j > 1 Then
ActiveSheet.Cells(1, j - 1).Interior.Color = xlNone
ActiveSheet.Cells(1, j - 1).Borders.LineStyle = xlLineStyleNone
ActiveSheet.Cells(1, j - 1).Value = ""
End If
ActiveSheet.Cells(1, j).Interior.Color = RGB(244, 176, 132)
ActiveSheet.Cells(1, j).Borders.LineStyle = xlContinuous
ActiveSheet.Cells(1, j).Borders.Weight = xlMedium
ActiveSheet.Cells(1, j).Value = ChrW(&H2192)
DoEvents
bm.TrackByName "Boucle J Droite"
Next j
DoEvents
ActiveSheet.Cells(5, 5).Value = ChrW(&H2192)
For j = 1 To 10
ActiveSheet.Cells(6, 4).Value = j
If j > 1 Then
ActiveSheet.Cells(j - 1, 10).Interior.Color = xlNone
ActiveSheet.Cells(j - 1, 10).Borders.LineStyle = xlLineStyleNone
ActiveSheet.Cells(j - 1, 10).Value = ""
End If
ActiveSheet.Cells(j, 10).Interior.Color = RGB(244, 176, 132)
ActiveSheet.Cells(j, 10).Borders.LineStyle = xlContinuous
ActiveSheet.Cells(j, 10).Borders.Weight = xlMedium
ActiveSheet.Cells(j, 10).Value = ChrW(&H2193)
DoEvents
bm.TrackByName "Boucle J Bas"
Next j
ActiveSheet.Cells(5, 5).Value = ChrW(&H2193)
For j = 1 To 10
ActiveSheet.Cells(6, 4).Value = j
If j > 1 Then
ActiveSheet.Cells(10, 11 - j + 1).Interior.Color = xlNone
ActiveSheet.Cells(10, 11 - j + 1).Borders.LineStyle = xlLineStyleNone
ActiveSheet.Cells(10, 11 - j + 1).Value = ""
End If
ActiveSheet.Cells(10, 11 - j).Interior.Color = RGB(244, 176, 132)
ActiveSheet.Cells(10, 11 - j).Borders.LineStyle = xlContinuous
ActiveSheet.Cells(10, 11 - j).Borders.Weight = xlMedium
ActiveSheet.Cells(10, 11 - j).Value = ChrW(&H2190)
DoEvents
bm.TrackByName "Boucle J Gauche"
Next j
ActiveSheet.Cells(5, 5).Value = ChrW(&H2190)
For j = 1 To 10
ActiveSheet.Cells(6, 4).Value = j
If j > 1 Then
ActiveSheet.Cells(11 - j + 1, 1).Interior.Color = xlNone
ActiveSheet.Cells(11 - j + 1, 1).Borders.LineStyle = xlLineStyleNone
ActiveSheet.Cells(11 - j + 1, 1).Value = ""
End If
ActiveSheet.Cells(11 - j, 1).Interior.Color = RGB(244, 176, 132)
ActiveSheet.Cells(11 - j, 1).Borders.LineStyle = xlContinuous
ActiveSheet.Cells(11 - j, 1).Borders.Weight = xlMedium
ActiveSheet.Cells(11 - j, 1).Value = ChrW(&H2191)
DoEvents
bm.TrackByName "Boucle J Haut"
Next j
bm.TrackByName "Boucle i"
Next i
bm.TrackByName ("Fin")
ActiveSheet.Cells(1, 1).Interior.Color = xlNone
ActiveSheet.Cells(1, 1).Borders.LineStyle = xlLineStyleNone
ActiveSheet.Cells(1, 1).Value = ""
ActiveSheet.Cells(5, 4).Value = ""
ActiveSheet.Cells(6, 4).Value = ""
ActiveSheet.Cells(5, 5).Value = ""
End Sub |
Partager