新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_Click()
Debug.Print vbString, vbArray, vbBoolean, vbByte, vbCurrency, vbDate, vbDouble
Debug.Print vbInteger, vbLong, vbSingle
'运行结果:
' 8 8192 11 17 6 7 5
' 2 3 4
Dim a() As Byte
Debug.Print VarType(a) '8209
Dim b As Byte
Debug.Print VarType(b) '17
Dim c As String
Debug.Print VarType(c) '8
End Sub
运行结果:
8 8192 11 17 6 7 5
2 3 4
8209
17
8