Constants are declared using the Const keyword : Data Type « Data Type « VBA / Excel / Access / Word






Constants are declared using the Const keyword

 
Sub Constants()
    Const PI = 3.14159
    Dim circumference As Single
    Dim diameter As Single
    diameter = 10.32
    circumference = PI * diameter
End Sub

 








Related examples in the same category

1.Common Data Types
2.variable answer will hold the value 32 after execution of this block, not 31.8 as you might want.