Tutorial 1 :
script VBA Tutorial 1 :
Public Sub tombolClear()
ActivePresentation.Slides(2).Shapes(“cek”).TextFrame.TextRange.Text = “”
Slide2.TextBox1.Text = “”
End Sub
Public Sub tombolPeriksa()
If Slide2.TextBox1.Text = “Tokyo” Then
ActivePresentation.Slides(2).Shapes(“cek”).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(2).Shapes(“cek”).TextFrame.TextRange.Text = “SALAH”
End If
End Sub
Tutorial 2 :
script VBA Tutorial 2 :
Public Sub tombolClear2()
ActivePresentation.Slides(3).Shapes(“cek1”).TextFrame.TextRange.Text = “”
ActivePresentation.Slides(3).Shapes(“cek2”).TextFrame.TextRange.Text = “”
ActivePresentation.Slides(3).Shapes(“cek3”).TextFrame.TextRange.Text = “”
ActivePresentation.Slides(3).Shapes(“cek4”).TextFrame.TextRange.Text = “”
ActivePresentation.Slides(3).Shapes(“cek5”).TextFrame.TextRange.Text = “”
Slide3.TextBox1.Text = “”
Slide3.TextBox2.Text = “”
Slide3.TextBox3.Text = “”
Slide3.TextBox4.Text = “”
Slide3.TextBox5.Text = “”
End Sub
Public Sub tombolPeriksa2()
‘periksa soal no 1
If Slide3.TextBox1.Text = “Tokyo” Then
ActivePresentation.Slides(3).Shapes(“cek1”).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(3).Shapes(“cek1”).TextFrame.TextRange.Text = “SALAH”
End If
‘periksa soal no 2
If Slide3.TextBox2.Text = “Teheran” Then
ActivePresentation.Slides(3).Shapes(“cek2”).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(3).Shapes(“cek2”).TextFrame.TextRange.Text = “SALAH”
End If
‘periksa soal no 3
If Slide3.TextBox3.Text = “Moskow” Then
ActivePresentation.Slides(3).Shapes(“cek3”).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(3).Shapes(“cek3”).TextFrame.TextRange.Text = “SALAH”
End If
‘periksa soal no 4
If Slide3.TextBox4.Text = “London” Then
ActivePresentation.Slides(3).Shapes(“cek4”).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(3).Shapes(“cek4”).TextFrame.TextRange.Text = “SALAH”
End If
‘periksa soal no 5
If Slide3.TextBox5.Text = “Paris” Then
ActivePresentation.Slides(3).Shapes(“cek5”).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(3).Shapes(“cek5”).TextFrame.TextRange.Text = “SALAH”
End If
End Sub
Tutorial 3 :
Public cekJawab As Variant
Public isiJawab As Variant
Public kunciJawab As Variant
Public Sub deklarasiArray()
cekJawab = Array(“cek1”, “cek2”, “cek3”, “cek4”, “cek5”)
isiJawab = Array(Slide4.TextBox1, Slide4.TextBox2, Slide4.TextBox3, _
Slide4.TextBox4, Slide4.TextBox5)
kunciJawab = Array(“Tokyo”, “Teheran”, “Moskow”, “London”, “Paris”)
End Sub
Public Sub tombolClear3()
Call deklarasiArray
For i = 0 To 4
ActivePresentation.Slides(4).Shapes(cekJawab(i)).TextFrame.TextRange.Text = “”
isiJawab(i).Text = “”
Next
End Sub
Public Sub tombolPeriksa3()
Call deklarasiArray
For i = 0 To 4
If isiJawab(i).Text = kunciJawab(i) Then
ActivePresentation.Slides(4).Shapes(cekJawab(i)).TextFrame.TextRange.Text = “BENAR”
Else
ActivePresentation.Slides(4).Shapes(cekJawab(i)).TextFrame.TextRange.Text = “SALAH”
End If
Next
End Sub
Tutorial 4 :
Script VBA Tutorial 4 :
Public cekJawab As Variant
Public isiJawab As Variant
Public kunciJawab As Variant
Public Sub deklarasiArray()
cekJawab = Array(“benar1”, “salah1”, “benar2”, “salah2”, “benar3”, “salah3”, _
“benar4”, “salah4”, “benar5”, “salah5”)
isiJawab = Array(Slide5.TextBox1, Slide5.TextBox2, Slide5.TextBox3, _
Slide5.TextBox4, Slide5.TextBox5)
kunciJawab = Array(“Tokyo”, “Teheran”, “Moskow”, “London”, “Paris”)
End Sub
Public Sub tombolClear4()
Call deklarasiArray
For i = 0 To 4
ActivePresentation.Slides(5).Shapes(cekJawab(2 * i)).Visible = msoFalse
ActivePresentation.Slides(5).Shapes(cekJawab(2 * i + 1)).Visible = msoFalse
isiJawab(i).Text = “”
Next
End Sub
Public Sub tombolPeriksa4()
Call deklarasiArray
For i = 0 To 4
If isiJawab(i).Text = kunciJawab(i) Then
ActivePresentation.Slides(5).Shapes(cekJawab(2 * i)).Visible = msoTrue
ActivePresentation.Slides(5).Shapes(cekJawab(2 * i + 1)).Visible = msoFalse
Else
ActivePresentation.Slides(5).Shapes(cekJawab(2 * i)).Visible = msoFalse
ActivePresentation.Slides(5).Shapes(cekJawab(2 * i + 1)).Visible = msoTrue
End If
Next
End Sub
Tutorial 5 :
Script VBA Tutorial 5 :
Public cekJawab As Variant
Public isiJawab As Variant
Public kunciJawab As Variant
Public nilai As Variant
Public nilaiTotal As Integer
Public Sub deklarasiArray()
cekJawab = Array(“benar1”, “salah1”, “benar2”, “salah2”, “benar3”, “salah3”, _
“benar4”, “salah4”, “benar5”, “salah5”)
isiJawab = Array(Slide6.TextBox1, Slide6.TextBox2, Slide6.TextBox3, _
Slide6.TextBox4, Slide6.TextBox5)
kunciJawab = Array(“Tokyo”, “Teheran”, “Moskow”, “London”, “Paris”)
nilai = Array(“0”, “0”, “0”, “0”, “0”)
End Sub
Public Sub tombolClear5()
Call deklarasiArray
For i = 0 To 4
ActivePresentation.Slides(6).Shapes(cekJawab(2 * i)).Visible = msoFalse
ActivePresentation.Slides(6).Shapes(cekJawab(2 * i + 1)).Visible = msoFalse
ActivePresentation.Slides(6).Shapes(“nilaiAnda”).TextFrame.TextRange.Text = “0”
isiJawab(i).Text = “”
Next
End Sub
Public Sub tombolPeriksa5()
Call deklarasiArray
nilaiTotal = 0
For i = 0 To 4
If isiJawab(i).Text = kunciJawab(i) Then
ActivePresentation.Slides(6).Shapes(cekJawab(2 * i)).Visible = msoTrue
ActivePresentation.Slides(6).Shapes(cekJawab(2 * i + 1)).Visible = msoFalse
nilai(i) = 20
Else
ActivePresentation.Slides(6).Shapes(cekJawab(2 * i)).Visible = msoFalse
ActivePresentation.Slides(6).Shapes(cekJawab(2 * i + 1)).Visible = msoTrue
nilai(i) = 0
End If
nilaiTotal = nilaiTotal + nilai(i)
Next
ActivePresentation.Slides(6).Shapes(“nilaiAnda”).TextFrame.TextRange.Text = nilaiTotal
End Sub
Link Download :
https://drive.google.com/file/d/0B_eVGY1-CRo3b1ZjQTRiREpVMTA/view?usp=sharing
No comments:
Post a Comment