variabili booleane

esercizio con variabile booleane
vedi
matema18.xls

Private Sub CommandButton1_Click()
Rem matema18
Dim a, b, c, d As Integer
Dim conferma As Boolean
a = Cells(1, 1)
b = Cells(1, 2)
c = Cells(1, 3)
d = Cells(1, 4)
If a > b Then
Cells(2, 1) = a - b
End If
If a < b Then
Cells(2, 2) = b - a
End If
If a >= b Then
Cells(2, 3) = a - b
End If
If a > b Then
Cells(3, 1) = a - b
Else
Cells(3, 2) = b - a
End If
If a < b And c < d Then
Cells(4, 1) = a * 10
Else
Cells(4, 2) = a * 100
End If
If a < b Or c > d Then
Cells(5, 1) = a * 5
Else
Cells(5, 2) = a * 8
End If
conferma = False
If a < b Then
conferma = True
If conferma Then
Cells(6, 1) = a * a
End If
End If
conferma = False
If a > b Then
conferma = True
If conferma Then
Cells(7, 1) = a * a
End If
Else
Cells(7, 2) = b * a
End If

End Sub

Private Sub CommandButton2_Click()
Rem cancella
For k = 1 To 8
For h = 1 To 4
Cells(k, h) = ""
Next h
Next k
End Sub