In VB.NET, a variable is declared using the syntax
I have just discovered that in VBA this does not work, and must instead be written as either
or as
Is the second of these an acceptable way of declaring a variable? If not, what problems might be encountered if the datatype is not specified?
Code:
Dim Foo As Integer = 10
I have just discovered that in VBA this does not work, and must instead be written as either
Code:
Dim Foo As Integer
Foo = 10
or as
Code:
Foo = 10
Is the second of these an acceptable way of declaring a variable? If not, what problems might be encountered if the datatype is not specified?