1、变量的数据类型
2、声明变量的数据类型
格式:dim 变量名 as 数据类型
dim n as string
dim n$
Sub VBA练习()
MsgBox "我会写VBA代码了!"
End Sub
Sub test1()
n = 1
y = n * 100
MsgBox y
End Sub
Sub test2()
y = InputBox("请输入你的出生年份:")
n = 2022 - y
MsgBox ("你已经" & n & "岁了!")
End Sub