如何用C语言将一个数组中的值添加到excel表中 20
1个回答
展开全部
Dim stu(1 To 10, 1 To 5) '定义一个二维数组,
Dim i As Integer '定义变量
Dim j As Integer '定义变量
For i = 1 To 10 '从1到10循环,即数组第一维循环
For j = 1 To 5 '从1到5循环,即数组第二维循环
a(i)(j) = 0 '给数组stu(i,j)=0赋值为零,你这句话有问题呀,a数组哪来的?并且vb二维数组不是这么个写法!!!
Next i '这两句话也错了,应该是先next j,再next i !!!
Next j
End Sub
dim stu(1 to 10) as integer '定义一个一维数组,从1到10
dim l as integer '定义变量
for i=1 to 10 '从1到10的循环
a(i)=0 '将数组第i个的值赋值为0,数组名又错了 不是a 是 stu
next i
以下是我给你修改后的代码~~
Private Sub Form_click()
Dim stu(1 To 10, 1 To 5)
Dim i As Integer
Dim j As Integer
For i = 1 To 10
For j = 1 To 5
stu(i,j) = 0
Next j
Next i
End Sub
dim stu(1 to 10) as integer
dim l as integer
for i=1 to 10
stu(i)=0
next i
答案补充
你这个都是给数组赋值,赋的值都是0,
数组得到的值都是0
Dim i As Integer '定义变量
Dim j As Integer '定义变量
For i = 1 To 10 '从1到10循环,即数组第一维循环
For j = 1 To 5 '从1到5循环,即数组第二维循环
a(i)(j) = 0 '给数组stu(i,j)=0赋值为零,你这句话有问题呀,a数组哪来的?并且vb二维数组不是这么个写法!!!
Next i '这两句话也错了,应该是先next j,再next i !!!
Next j
End Sub
dim stu(1 to 10) as integer '定义一个一维数组,从1到10
dim l as integer '定义变量
for i=1 to 10 '从1到10的循环
a(i)=0 '将数组第i个的值赋值为0,数组名又错了 不是a 是 stu
next i
以下是我给你修改后的代码~~
Private Sub Form_click()
Dim stu(1 To 10, 1 To 5)
Dim i As Integer
Dim j As Integer
For i = 1 To 10
For j = 1 To 5
stu(i,j) = 0
Next j
Next i
End Sub
dim stu(1 to 10) as integer
dim l as integer
for i=1 to 10
stu(i)=0
next i
答案补充
你这个都是给数组赋值,赋的值都是0,
数组得到的值都是0
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询