You should also be careful about mixing numerical data types in mathematical operations : Byte « Data Type « VBA / Excel / Access / Word






You should also be careful about mixing numerical data types in mathematical operations

 
Sub Mix()
    Dim myAnswer As Byte
    Dim num1 As Single
    Dim num2 As Byte
    num1 = 4.1
    num2 = 5
    myAnswer = num1 * num2
End Sub

 








Related examples in the same category

1.Attempts to store the numbers 52 and 5.2 in a variable declared as type Byte.