VBA问题,两个数组A(1,1 To 1,5)和B(1,1 To 1,5)要求比较他们包含的元素是否相同.
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/11 15:59:36
VBA问题,两个数组A(1,1 To 1,5)和B(1,1 To 1,5)要求比较他们包含的元素是否相同.
比方说A数组包含1、2、10、7、4,B数组包含1、2、4、7、10则他们是相同的.
比方说A数组包含1、2、10、7、4,B数组包含1、2、4、7、10则他们是相同的.
Sub test()
a1 = Array(1, 2, 10, 7, 4)
a2 = Array(1, 2, 7, 4, 10)
tempArray1 = a1
tempArray2 = a2
For i = 0 To 4
For j = 0 To 4
If tempArray1(i) "" And tempArray2(j) "" Then
If tempArray1(i) = tempArray2(j) Then
tempArray1(i) = ""
tempArray2(j) = ""
End If
End If
Next j
Next i
For i = 0 To 4
If tempArray1(i) "" Or tempArray2(i) "" Then
Count = Count + 1
End If
Next i
If Count = 0 Then
MsgBox "the two arrays are the same"
Else
MsgBox "the two arrays are different"
End If
End Su
a1 = Array(1, 2, 10, 7, 4)
a2 = Array(1, 2, 7, 4, 10)
tempArray1 = a1
tempArray2 = a2
For i = 0 To 4
For j = 0 To 4
If tempArray1(i) "" And tempArray2(j) "" Then
If tempArray1(i) = tempArray2(j) Then
tempArray1(i) = ""
tempArray2(j) = ""
End If
End If
Next j
Next i
For i = 0 To 4
If tempArray1(i) "" Or tempArray2(i) "" Then
Count = Count + 1
End If
Next i
If Count = 0 Then
MsgBox "the two arrays are the same"
Else
MsgBox "the two arrays are different"
End If
End Su
VBA问题,两个数组A(1,1 To 1,5)和B(1,1 To 1,5)要求比较他们包含的元素是否相同.
VBA问题,两个数组A(1,1 To 1,5)和B(1,1 To 1,5),求A(1,1)-B(1,1)+A(1,2)-
如下数组声明语句中,数组a包含元素的个数为:( ) Dim a(1 to 3,-2 to 2,3)
数组a(10)的元素个数为 ,数组a(1 to 10)的元素个数为
Dim A(1 To 6,6) As String定义的数组包含的元素个数是( ).
VBA,定义一个二维数组arr(1 to 20,1 to y),求arr(k,1 to y)的平均数和标准差?
excel VBA 中怎么定义一个数组xx(1 to 100)
一个数组说明为Dim a(5,1 to 5) As Integer,则该数组共有(C) 个元素.A、25 B、3
有一数组b中,包含有10个元素:1,2,3,4,5,6,7,8,9,10,要求分别用:
option base 1 dim a(3,-2 to 2,4)数组a包含元素个数有 2 option base 0 d
在VBA中,定义了二维数组A(2 to 5,5)则该数组中的元素个数为()
语句Dim a&(1 To 20),b#(2,-1 To 1)定义两个数组,其类型分别为