It seems to be gospel that an untyped variable will be defaulted to type variant. I decided to try and verify that. Here's the result.
It seems that a variable without an explicit Type assignment when declared, will take on the Type of its later assigned value.
Interestingly, a declared variant without a value assignment will have Type 'Empty'
Code:
Public Sub DT()
Dim s1, s2 As String: s1 = "Hello World"
Dim b1, b2 As Boolean: b1 = "Me Too"
Dim n1, n2 As Long: n1 = False
Dim v1, v2 As Variant: v1 = #12/1/2020#
Debug.Print "s1 Type result:"; TypeName(s1)
Debug.Print "s2 Type result:"; TypeName(s2)
Debug.Print "b1 Type result:"; TypeName(b1)
Debug.Print "b2 Type result:"; TypeName(b2)
Debug.Print "n1 Type result:"; TypeName(n1)
Debug.Print "n2 Type result:"; TypeName(n2)
Debug.Print "v1 Type result:"; TypeName(v1)
Debug.Print "v2 Type result:"; TypeName(v2)
End Sub
Immediate:
call dt
s1 Type result:String
s2 Type result:String
b1 Type result:String
b2 Type result:Boolean
n1 Type result:Boolean
n2 Type result:Long
v1 Type resultate
v2 Type result:Empty