當前位置:成語大全網 - 新華字典 - Excel VBA中如何判斷兩組集合是否相等

Excel VBA中如何判斷兩組集合是否相等

用字典,將集合的元素放入字典。

第壹步:字典初始化;

第二步:比較判斷

function 相等判斷(a,b)

相等判斷=false

for each mykey in a.keys

if not b.exists(mykey) then

exit function

endif

next mykey

for each mykey in b.keys

if not a.exists(mykey) then

exit function

endif

next mykey

相等判斷=true

end function