”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 08:50:39
”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3

”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3
”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3

”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3
Sub createdictionary()
arr = Array(2,2,4,5)
Set dic = CreateObject("scripting.dictionary")
For Each a In arr
If Not dic.exists(a) Then dic.Add a,""
Next
MsgBox "这一组数据中不重复的数据个数为" & dic.Count & "个"
End Sub