”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3
答案:4 悬赏:60
解决时间 2021-04-28 05:46
- 提问者网友:冥界祭月
- 2021-04-27 21:46
”excel vba 有4个数2,2,4,5 用循环相互对比,得出这4个数中有3个互不相同的数的个数是3
最佳答案
- 二级知识专家网友:时光不老我们不分离
- 2021-04-27 21:53
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
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
全部回答
- 1楼网友:茫然不知崩溃
- 2021-04-28 00:06
这4个数中有3吗?
- 2楼网友:爱情是怎么炼成的
- 2021-04-27 22:56
dim i ,j
dim m
dim a()
a(1)=2
a(2)=2
a(3)=4
a(4)=5
for i =1 to 4
for j=i+1 to 4
if a(i)<>a(j) then
m=m+1
end if
next j
next i
msgbox m
- 3楼网友:努力只為明天
- 2021-04-27 22:43
public sub 统计()
dim i as integer,n as integer
n=0
for i=1 to 12 step 1
if len(cells(i,1))>0 then
n=n+1
end if
next i
cells(1,2)=n
end
'则运行后b1单元格显示的数据即a1:a12区域数据的个数!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息