Powerpoint Interaktif (dengan VBA) : Pembagian dengan 2

RBAK_powerfulPPTPada posting ini, akan saya jelaskan bagaimana membuat powerpoint interaktif untuk pembagian dengan 2

gbr_pembagian2Insert shapes rectangle, text box dan command button seperti pada gambar. Kemudian pilih View Code pada kelompok Controls – tab Developer ketikkan script berikut :

Private Sub ScrollBar1_Change()
For i = 1 To 20
ActivePresentation.Slides(2).Shapes(i).Fill.BackColor.RGB = RGB(255, 255, 255)
ActivePresentation.Slides(2).Shapes(i).Fill.ForeColor.RGB = RGB(255, 255, 255)
Next

For i = 1 To Val(ScrollBar1)
ActivePresentation.Slides(2).Shapes(i).Fill.BackColor.RGB = RGB(255, 0, 0)
ActivePresentation.Slides(2).Shapes(i).Fill.ForeColor.RGB = RGB(255, 0, 0)
Next

For i = 1 To 10
ActivePresentation.Slides(2).Shapes(20 + i).Visible = msoFalse
Next

ActivePresentation.Slides(2).Shapes(“Bilangan 1”).TextFrame.TextRange.Text = Val(ScrollBar1)
ActivePresentation.Slides(2).Shapes(“hasil”).TextFrame.TextRange.Text = “”

End Sub

Private Sub CommandButton1_Click()
For i = 1 To 10
ActivePresentation.Slides(2).Shapes(20 + i).Visible = msoFalse
Next

For i = 1 To Val(ScrollBar1) / 2
ActivePresentation.Slides(2).Shapes(20 + i).Visible = msoTrue
Next
ActivePresentation.Slides(2).Shapes(“hasil”).TextFrame.TextRange.Text = Val(ScrollBar1) / 2

End Sub

download : file powerpoint interaktif

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s