In response to post 5 and 6, maybe not. Here's some data.
Code:
Public Sub TestDim1()
Dim s1, s2 As String
Dim s3, s4 As Long
Dim s5, s6 As Date
Debug.Print "s1 " & VarType(s1), TypeName(s1)
Debug.Print "s2 " & VarType(s2), TypeName(s2)
Debug.Print "s3 " & VarType(s3), TypeName(s3)
Debug.Print "s4 " & VarType(s4), TypeName(s4)
Debug.Print "s5 " & VarType(s5), TypeName(s5)
Debug.Print "s6 " & VarType(s6), TypeName(s6)
End Sub
call testdim1
s1 0 Empty
s2 8 String
s3 0 Empty
s4 3 Long
s5 0 Empty
s6 7 Date
Above, when s1, s3 and s5 are not explicitly typed, the results show empty, or not defined.
Code:
Public Sub TestDim2()
Dim s1, s2 As String
Dim s3, s4 As Long
Dim s5, s6 As Date
s1 = "Hello"
s3 = 100000000.222222
s5 = CDate("1/1/2020")
Debug.Print "s1 " & VarType(s1), TypeName(s1)
Debug.Print "s2 " & VarType(s2), TypeName(s2)
Debug.Print "s3 " & VarType(s3), TypeName(s3)
Debug.Print "s4 " & VarType(s4), TypeName(s4)
Debug.Print "s5 " & VarType(s5), TypeName(s5)
Debug.Print "s6 " & VarType(s6), TypeName(s6)
End Sub
call testdim2
s1 8 String
s2 8 String
s3 5 Double
s4 3 Long
s5 7 Date
s6 7 Date
However, when untyped variables are assigned a value, they take on the type of the value.
So the conclusion is that the types are implicitly assigned when the variable is given a value. This is probably OK in most cases.
The old mantra that variables without a declared type are automatically declared as variants appears to be false. Live and learn.