|
一开始忘了去想instr
Sub test()
Dim A(), j%, x%, y%
x = [a1]
A = [D3:g5].Value
For j = 1 To UBound(A, 2)
y = A(3, j)
A(1, j) = IIf(zh(x) + zh(y) <> zh(x & y), 1, 0)
Next j
[d3].Resize(UBound(A), UBound(A, 2)) = A
End Sub
Function zh(str) '去重复数字后的长度
Dim i, t, B(9)
For i = 1 To Len(str)
t = Mid(str, i, 1)
B(t) = t
Next i
zh = Len(Join(B, ""))
End Function
|
|