Option
Explicit
Sub
Test()
Dim
m, vm
Dim
z3
As
String
z3 =
"01.01.2015"
m =
Date
-
CDate
(z3)
MsgBox
"Der Wert von m "
& Format(m,
"#0"
) & Chr(13) & _
"Dazu Typ von m : "
& GetVarType1(m)
End
Sub
Private
Function
GetVarType1(vType
As
Variant
)
As
String
Select
Case
VarType(vType)
Case
0
GetVarType1 =
"vbEmpty"
Case
1
GetVarType1 =
"vbNull"
Case
2
GetVarType1 =
"vbInteger"
Case
3
GetVarType1 =
"vbLong"
Case
4
GetVarType1 =
"vbSingle"
Case
5
GetVarType1 =
"vbDouble"
Case
6
GetVarType1 =
"vbCurrency"
Case
7
GetVarType1 =
"vbDate"
Case
8
GetVarType1 =
"vbString"
Case
9
GetVarType1 =
"vbObject"
Case
10
GetVarType1 =
"vbError"
Case
11
GetVarType1 =
"vbBoolean"
Case
12
GetVarType1 =
"vbVariant"
Case
13
GetVarType1 =
"vbDataObject"
Case
14
GetVarType1 =
"vbDecimal"
Case
17
GetVarType1 =
"vbByte"
Case
Is
>= 8192
GetVarType1 =
"vbArray"
Case
Else
GetVarType1 = vbNullString
End
Select
End
Function