try this:
- Sub zz()
- Dim ar, br(), s$, a%, b%, c%, s3%, s4$, s5$, s6$, t$
- ar = Sheets(1).Range("a2:ae" & Sheets(1).[a1048576].End(3).Row).Value
- ReDim br(1 To UBound(ar), 1 To 26)
- t = "0123456789"
- For i = 1 To UBound(ar)
- a = ar(i, 1): b = ar(i, 2): c = ar(i, 3): s3 = Right(b + c, 1):
- For j = 6 To UBound(ar, 2)
- s = ar(i, j): s4 = Mid(s, 3, 3): s5 = Mid(s, 4, 1) & Mid(s, 1, 1): s6 = t
- For jj = 1 To Len(s)
- s6 = Replace(s6, Mid(s, jj, 1), "")
- Next
- br(i, j - 5) = IIf(InStr(s, b), "Y", "N") 's1
- br(i, j - 5) = br(i, j - 5) & "," & IIf(InStr(s, c), "Y", "N") 's2
- br(i, j - 5) = br(i, j - 5) & "," & IIf(Right(s, 1) = s3, "Y", "N") 's3
- br(i, j - 5) = br(i, j - 5) & "," & IIf(InStr(s4, a), "Y", "N") 's4
- br(i, j - 5) = br(i, j - 5) & "," & IIf(InStr(s5, b), "Y", "N") 's5
- br(i, j - 5) = br(i, j - 5) & "," & IIf(InStr(s6, b), "Y", "N") 's5
- Next
- Next
- Sheets(3).Copy
- [b2].Resize(UBound(br), 26) = br
- End Sub
复制代码
|