成语大全网 - 汉语词典 - VBA 字典用法

VBA 字典用法

原VBA:

For i& = 1 To UBound(ar)

If d.Exists(ar(i, 1)) Then

ar(i, 1) = d(ar(i, 1))

Else

ar(i, 1) = "0"

End If

Next

修改为:

For i& = 1 To UBound(ar)

v=ar(i,1)

match_result="0"

for each k in d.Keys

if instr(v,k) then match_result=d(k)

next k

ar(i, 1) = match_result

Next