by Dinesh Thakur Category: Object-oriented programming (OOP)

Declaring variables means naming the variable and specifying their data types, that is declaration statements establish our project’s variables and constants give them names, and specify the data type they will hold.


These declaration statements are not considered as executable ; that is, they are not executed in flow of instructions during program execution.

Although these are several ways of declaring the variables, the most commonly used way is the Dim statements with the data type. We can omit the data type, then default data type becomes variant.


Here are some sample examples for declaration statement :


Dim strName as String ‘Declared the String variable

Dim intCount as Integer ‘Declared an Integer variable

Dim curDiscount as Currency ‘Declared a currency variable.


About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.