Assert : Debug.Assert « Language Basics « VBA / Excel / Access / Word






Assert

 
Sub addNumbers2()
   Dim intNumber1 As Integer
   Dim intNumber2 As Integer
   Dim intSum As Integer
   intNumber1 = 5
   intNumber2 = 3
   Debug.Assert intNumber1 = 5
   Debug.Assert intNumber2 = 7

   intSum = intNumber1 + intNumber2
   Debug.Print "The sum of the two numbers is: " & intSum
End Sub

 








Related examples in the same category

1.Using Assertions