¥»©«³Ì«á¥Ñ starry1314 ©ó 2018-9-5 09:54 ½s¿è
½Ð±Ð½d¨Ò.rar (19.2 KB)
Q:¥Ø«eµ{¦¡½XINSTR·|«½Æ²Îp¥]§tªºÈ¨Ò(AK,K)
¬G·Q®M¥Î¦¹¤½¦¡¨ú¥X©Ònªº¥N¸¹«á¦A¶i¦æ§PÂ_
¦]¦b¨Ï¥ÎVBA©I¥s¤º«Ø¨ç¼Æ·|°õ¦æ¥¢±Ñ( ¤£¯à¥Î°}¦C?)
If Application.WorksheetFunction.Mid(A, 3,Match(, 0 * Mid(A, {4, 5, 6, 7, 8, 9}, 1), 1)) = arr(1, J) Then Jm = J:Exit For
½Ð°Ý¥i«ç¼Ë§ï¼g©O??
- Sub ²Îp¤£ÄÝ©ó¥k°¼¥N¸¹¤§¼Æ¶q()
- Dim A, xD, arr, Brr, J&, Jm&, k%
- Set xD = CreateObject("Scripting.Dictionary")
- arr = [¤u§@ªí1!H1:X1]
- ReDim Brr(1 To 2, 1 To UBound(arr, 2))
- For Each A In Range([¤u§@ªí1!A2], [¤u§@ªí1!A1].Cells(Rows.Count, 1).End(xlUp)(3)).Value
- If A = "0" Or xD(A) = 1 Then GoTo 101
- Jm = 1
- For J = 1 To UBound(arr, 2) ' Step 2
- If InStr(A, arr(1, J)) Then Jm = J: Exit For
- Next J
- If InStr(A, "V") Then k = 2 Else k = 1
- Brr(k, Jm) = Brr(k, Jm) + 1
- xD(A) = 1
- 101: Next
- With Sheets("¤u§@ªí1")
- .Range("G3:G4") = Brr
- End With
- End Sub
½Æ»s¥N½X
- Sub ²Îp¥k°¼¥N¸¹¤§¼Æ¶q()
- Dim i
- For i = 8 To 25 'Cells(3, ActiveSheet.Columns.Count).End(xlToLeft).Column '18 '????
- 'Cells(5, ActiveSheet.Columns.Count).End(xlToLeft).Column 1
- Dim A, xD, t$(1), n&(1), ¦r¼Æ
- Set xD = CreateObject("Scripting.Dictionary")
- ?r?? = LenB(StrConv(Sheets("¤u§@ªí1").Cells(2, i), vbFromUnicode))
- t(0) = Mid(Sheets("¤u§@ªí1").Cells(2, i), 1, ¦r¼Æ - 1)
- t(1) = Mid(Sheets("¤u§@ªí1").Cells(2, i), ¦r¼Æ, 1)
- For Each A In Range([¤u§@ªí1!A2], [¤u§@ªí1!A1].Cells(Rows.Count, 1).End(xlUp)(3)).Value
- If A = "0" Or xD(A) = 1 Then GoTo 101
- If InStr(A, t(0)) Then
- If InStr(A, t(1)) Then n(1) = n(1) + 1 Else n(0) = n(0) + 1
- End If
- xD(A) = 1
- 101: Next
- Sheets("¤u§@ªí1").Cells(3, i) = n(0)
- Sheets("¤u§@ªí1").Cells(4, i) = n(1)
- xD.RemoveAll
- Erase t
- Erase n
- A = ""
- Next
½Æ»s¥N½X |