Sunday, November 13, 2016

Simple Racing



KELOMPOK : 25 , 26 , 31
ANGGOTA    : 1. MAULANA AULIYA R.
                           2. MUHAMAD ARIF
                           3. NUGRAHA DIMAS A.
KELAS           : X TKJ 2
TAHUN AJARAN 2016/2017



 


INTERMEZZO

Sub Button2_Click()
Range("B9").Select
ActiveCell.Interior.ColorIndex = 3

ActiveCell.Offset(1, 0).Interior.ColorIndex = 5
Kanan
Simpang1
Simpang2
AtasBawah
KananKiri
Kiri1
Kiri2
Selesai
End Sub

Sub Kanan()
Waktu = Range("A3").Value
For i = 1 To 8
ActiveCell.Offset(0, 1).Select
ActiveCell.Interior.ColorIndex = 3
ActiveCell.Offset(0, -1).ClearFormats
ActiveCell.Offset(1, 0).Interior.ColorIndex = 5
ActiveCell.Offset(1, -1).ClearFormats
If i > 2 Then
ActiveCell.Offset(0, -2).Interior.ColorIndex = 1
ActiveCell.Offset(0, -3).ClearFormats
Else

End If
For j = 1 To Waktu
Range("A4") = j
Next
Next
End Sub
Sub Simpang1()
Waktu = Range("A3").Value
ActiveCell.Offset(-1, 0).Interior.ColorIndex = 3
ActiveCell.ClearFormats
ActiveCell.Offset(1, 1).Interior.ColorIndex = 5
ActiveCell.Offset(1, 2).Interior.ColorIndex = 5
ActiveCell.Offset(0, -1).Interior.ColorIndex = 1
ActiveCell.Offset(0, -2).ClearFormats
For k = 1 To 2 * Waktu
Range("A4") = k
Next
End Sub
Sub Simpang2()
Waktu = Range("A3").Value
ActiveCell.Offset(-2, 0).Interior.ColorIndex = 3
ActiveCell.Offset(-1, 0).ClearFormats
ActiveCell.Offset(1, 0).ClearFormats
ActiveCell.Offset(1, 1).ClearFormats
ActiveCell.Offset(1, 2).ClearFormats
ActiveCell.Offset(2, 2).Interior.ColorIndex = 5
ActiveCell.Offset(0, 2).Interior.ColorIndex = 1
ActiveCell.Offset(0, 1).Interior.ColorIndex = 1
ActiveCell.Interior.ColorIndex = 1
ActiveCell.Offset(0, -1).ClearFormats
For m = 1 To 2 * Waktu
Range("A4") = m
Next
End Sub
Sub AtasBawah()
Waktu = Range("A3").Value
ActiveCell.Offset(0, 2).Select
For i = 1 To 4
ActiveCell.Offset(0, 1).Select
ActiveCell.Interior.ColorIndex = 1
ActiveCell.Offset(0, -1).ClearFormats
ActiveCell.Offset(0, -2).ClearFormats
ActiveCell.Offset(0, -3).ClearFormats

ActiveCell.Offset(-2 - i, -2 - i).Interior.ColorIndex = 3
ActiveCell.Offset(-1 - i, -2 - i).ClearFormats

ActiveCell.Offset(1 + i, -i).Interior.ColorIndex = 5
ActiveCell.Offset(i, -i).ClearFormats
For j = 1 To Waktu
Range("A4") = j
Next
Next
End Sub
Sub KananKiri()
Waktu = Range("A3").Value
For i = 1 To 4
ActiveCell.Offset(0, 1).Select
ActiveCell.Interior.ColorIndex = 1
ActiveCell.Offset(0, -1).ClearFormats

ActiveCell.Offset(4 + i, -4 - i).Interior.ColorIndex = 5
ActiveCell.Offset(3 + i, -4 - i).ClearFormats

ActiveCell.Offset(1, 4 - 2 * i).Interior.ColorIndex = 4
ActiveCell.Offset(1, 5 - 2 * i).ClearFormats
For j = 1 To Waktu
Range("A4") = j
Next
Next
End Sub
Sub Kiri1()
Waktu = Range("A3").Value
ActiveCell.Offset(1, -4).Select
For i = 1 To 3
ActiveCell.Offset(0, -1).Select
ActiveCell.Interior.ColorIndex = 4
ActiveCell.Offset(0, 1).ClearFormats
For j = 1 To Waktu
Range("A4") = j
Next
Next
ActiveCell.ClearFormats
ActiveCell.Offset(0, -1).Interior.ColorIndex = 4
ActiveCell.Offset(0, -2).Interior.ColorIndex = 4
ActiveCell.Offset(0, -3).Interior.ColorIndex = 4
End Sub
Sub Kiri2()
Waktu = Range("A3").Value
ActiveCell.Offset(0, -3).Select
For i = 1 To 8
ActiveCell.Offset(0, -1).Select
ActiveCell.Interior.ColorIndex = 4
ActiveCell.Offset(0, 1).ClearFormats
ActiveCell.Offset(0, 2).ClearFormats
ActiveCell.Offset(0, 3).ClearFormats
For j = 1 To Waktu
Range("A4") = j
Next
Next
End Sub
Sub Selesai()
MsgBox "Sudah selesai "
Range("B:Z").ClearFormats
End Sub












No comments:

Post a Comment