问题
单项选择题
下列数组声明语句中,正确的是
A.Dim A[3,4] As Integer
B.Dim A(3,4) As Integer
C.Dim A[3;4] As Integer
D.Dim A(3;4) As Integer
答案
参考答案:B
解析: 本题考查的是VBA编程基础、数组变量的定义。在VBA中数组声明的格式为:Dim数组名(维数定义) As类型,声明数组要用圆括号,当定义多维数组时,维数之间要用逗号隔开。Dim A(3,4)As Integer定义了一个二维数组,表示有4×5=20个元素。