老师好,下面代码是从Foxtable10个数中随机抽取数据填入EXCEL中,如果要将Foxtable中的数据一一对应填入EXCEL中,应该怎么更改代码?(第一行的数据对应填入到excel中的第一行),谢谢!
Dim nums1 As new List(Of String)
Dim nums2 As new List(Of String)
Dim nums3 As new List(Of String)
For Each dr As DataRow In DataTables("电解电容检验记录录入").Select("电容量测试值 is not null and 材料代号 = '" & Tables("电解电容").current("材料代号") & "' ” )
nums1.Add(dr("电容量测试值"))
nums2.add(dr("损耗角正切测试值"))
nums3.add(dr("漏电流测试值"))
Next
For i As Integer = 1 To 30
If d1=0 Then Exit For
If i > d1 Then Exit For
sheet(62+i, 3).value = nums1(Rand.Next(10))
sheet(62+i, 11).value = nums2(Rand.Next(10))
sheet(62+i, 19).value = nums3(Rand.Next(10))