Situs Dosen STKIP Siliwangi Bandung - Martin Bernard, S.Pd., M.Pd

Artikel Umum

Permainan Kotak ajaib di Microsoft Excel

Dipublikasikan pada : 24 April 2016. Kategori : .

Bahasa VBA untuk Microsoft Excel

Private Sub CommandButton1_Click()
Range(“C3:E5”) = “”

End Sub

Private Sub CommandButton2_Click()

End Sub

Private Sub CommandButton3_Click()
Dim baris As Long
Dim lembar As Worksheet
Set lembar = Worksheets(“Kotak ajaib”)
baris = lembar.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
lembar.Cells(baris, 1).Value = Range(“B1”)
lembar.Cells(baris, 3).Value = Range(“E9”)
End Sub

Private Sub Image1_Click()

End Sub

Private Sub Worksheet_Activate()
CommandButton2.Visible = False
If Range(“E9”) > 9 Then
Image1.Visible = True
End If
End Sub

Private Sub Worksheet_Calculate()

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim b As String
Dim c As Integer

b = Range(“I6”)
Image1.Visible = False
If b = “Benar” Then
Range(“I6”).Interior.Color = vbGreen
CommandButton2.Visible = True
Else
Range(“I6”).Interior.Color = vbRed
End If

End Sub

klik di youtube ini