The dim statement used in visual basic to declare variable with proper data type. By default, all variables used in visual basic programming without declaration treated as variant data type. With help of dim statement, variables are declared with proper data type. The dim statement can declare multiple data type with single statement as well as with multiple statement.

Syntax of the dim statement is –

Dim <Varaible1,Variable2, _ _ _ _ _ > as <Data Type>