ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý²Î­p¯S©w±ø¥ó¤£­«½Æ¤§¼Æ¶q¦p¦ó§ï¥HVBA°õ¦æ

¦^´_ 9# ­ã´£³¡ªL

©Î¬O¥i§_²Î­p¤£§tVªº¤£­«½ÆÁ`¼Æ¤w¤Î§tVªº¤£­«½ÆÁ`¼Æ
¦©±¼¨ä¥L¦C¥Xªº³æ¦ì¼Æ¶q§Y¥i±o¥X©Ò­n¼Æ¶q

TOP

¦^´_ 11# starry1314


Sub TEST()
Dim A, xD, Arr, Brr, j&, Jm&, k%
Set xD = CreateObject("Scripting.Dictionary")
Arr = [¤u§@ªí2!A3:N3]
ReDim Brr(1 To 2, 1 To UBound(Arr, 2))
For Each A In Range([¤u§@ªí1!c2], [¤u§@ªí1!c1].Cells(Rows.Count, 1).End(xlUp)).Value
¡@¡@If A = "" Or xD(A) = 1 Then GoTo 101
¡@¡@Jm = 1
¡@¡@For j = 3 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
[¤u§@ªí2!A5:N6] = Brr
End Sub

TOP

¦^´_ 12# ­ã´£³¡ªL
ÁÂÁÂ~¥i¥H¨Ï¥Î¡I
·Q½Ð°Ý
Brr(k, Jm) = Brr(k, Jm) + 1¡@³o¬qªº¡Ï¢°¬O¡H¡@
¦]¦pªGµL¸ê®Æªº¸Ü¼Æ¶q·|Åã¥Ü¢°

TOP

¥»©«³Ì«á¥Ñ ­ã´£³¡ªL ©ó 2015-11-10 16:45 ½s¿è

¦^´_ 13# starry1314


¨º¬O²Ö­p¤£­«ÂЭӼÆ!
¨S¸ê®ÆÅã¥Ü1? ¤°»ò·N«ä?§ï¦¨¥H¤U:Åý¸ê®Æ½d³ò¦h¥[¤G¦CªÅ¥Õ¦C
For Each A In Range([¤u§@ªí1!c2], [¤u§@ªí1!c1].Cells(Rows.Count, 1).End(xlUp)(3)).Value

TOP

¦^´_ 14# ­ã´£³¡ªL
ÁÂÁÂ~¼Æ¶q¤w¥¿±`
¨S¸ê®ÆÅã¥Ü0¬O  §Ú§â¸ê®Æ²MªÅ¥u¯d¼ÐÃD¥¦·|­pºâ¬°1

TOP

¥»©«³Ì«á¥Ñ starry1314 ©ó 2016-2-22 09:00 ½s¿è

¦^´_ 14# ­ã´£³¡ªL

ª©¤j~¤£¦n·N«ä
·Q½Ð°Ý¥H¤U¦p¦óÅý¥L¦b°õ¦æ¹Lµ{¤¤¹J¨ìªÅ¥Õ¦C¤£+1©O?
¨Ò:¦³¤C­Ó¤£¦Pªº½s¸¹ ¥L¤¤¶¡¬ï´¡¤F¤@­ÓªÅ¥Õ®æ
¥X¨Óªº¼Æ¶q·|Åܬ°8(²Î­p¨ìªÅ¥Õ®æ¤F)
  1. Sub test()

  2. ­ì¥»·Q»¡±NÁ`µ²ªG-1
  3. ¦ý¦]¤£¬O¨C¦¸³£­è¦n¦³ªÅ¥Õ®æ,¦³®É·|¬Ò¦³¼Æ¾Ú³o¼Ë¸ò¹ê»Ú¤S¤Ö1¤F

  4. Dim A, xD, T$(1), N&(1)
  5. Set xD = CreateObject("Scripting.Dictionary")
  6. T(0) = Mid([°t¿¯Á`ªí_¦­!C3], 1, 1)
  7. T(1) = Mid([°t¿¯Á`ªí_¦­!C3], 2, 1)
  8. For Each A In Range([¤u§@ªí1!C2], [¤u§@ªí1!C1].Cells(Rows.Count, 1).End(xlUp)(3)).Value
  9.     If A = "" Or xD(A) = 1 Then GoTo 101
  10.     If InStr(A, T(0)) Then
  11.         If InStr(A, T(1)) Then N(1) = N(1) + 1 Else N(0) = N(0) + 1
  12.     End If
  13.     xD(A) = 1
  14. 101: Next
  15. [°t¿¯Á`ªí_¦­!C5] = N(0)
  16. [°t¿¯Á`ªí_¦­!C6] = N(1)
½Æ»s¥N½X

TOP

¦^´_ 14# ­ã´£³¡ªL

­ì¥»·Q»¡±NÁ`µ²ªG-1
¦ý¦]¤£¬O¨C¦¸³£­è¦n¦³ªÅ¥Õ®æ,¦³®É·|¬Ò¦³¼Æ¾Ú³o¼Ë¸ò¹ê»Ú¤S¤Ö1¤F
If A = "0" Or xD(A) = 1 Then GoTo 101

¥H¸Ñ¨M ¤£ª¾³o¼Ë·|¦³¤°»ò¿ù»~¶Ü?
  1. Sub test()
  2. Dim A, xD, T$(1), N&(1)
  3. Set xD = CreateObject("Scripting.Dictionary")
  4. T(0) = Mid([°t¿¯Á`ªí_¦­!C3], 1, 1)
  5. T(1) = Mid([°t¿¯Á`ªí_¦­!C3], 2, 1)
  6. For Each A In Range([¤u§@ªí1!C2], [¤u§@ªí1!C1].Cells(Rows.Count, 1).End(xlUp)(3)).Value
  7.     If A = "" Or xD(A) = 1 Then GoTo 101
  8.     If InStr(A, T(0)) Then
  9.         If InStr(A, T(1)) Then N(1) = N(1) + 1 Else N(0) = N(0) + 1
  10.     End If
  11.     xD(A) = 1
  12. 101: Next
  13. [°t¿¯Á`ªí_¦­!C5] = N(0)
  14. [°t¿¯Á`ªí_¦­!C6] = N(1)
½Æ»s¥N½X

TOP

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2017/5/13 06:48): ½Ðªþø¬¬Ý¬Ý

ª©¤j ¤£¦n·N«ä,
­ì¥»¤W¤èªºµ{¦¡½X¬O¤@¦¸¥u­pºâ¤@ºØ¤H¼Æ,¦pªG­n²Î­p8ºØ¤£¦P±ø¥óªº¤H¼Æ
´N¥²¶·°µ8ºØµ{¦¡

¹Á¸Õ§ï¦¨¥H¤UÅý¥L¨Ì§Ç¤@ª½²Î­p¤U¥h
¦ý¦b FOR EACH³o¦æ·|¹J¨ì°}¦Cªø«×Âê©w,¤£ª¾«ç»ò§â¥¦°µ²M°£
¬d¸ê®Æ»¡ ¶i¤J°j°é«á´N·|Âê¦í ¥u¯àŪ¨úµLªk¼g¤J,

  1. Sub ²Î­p¤H¼Æ()
  2. Dim A, xD, t$(1), n&(1), i
  3. Set xD = CreateObject("Scripting.Dictionary")

  4. For i = 3 To Cells(ActiveSheet.Rows.Count, 1).End(xlUp).Row
  5. t(0) = Mid(Range("B" & i), 1, 2)
  6. t(1) = Mid(Range("B" & i), 3, 1)
  7. For Each A In Range([¤u§@ªí1!C2], [¤u§@ªí1!C1].Cells(Rows.Count, 1).End(xlUp)(3)).Value
  8. If A = "0" Or xD(A) = 1 Then GoTo 101
  9.     If InStr(A, t(0)) Then
  10.         If InStr(A, t(1)) Then n(1) = n(1) + 1 Else n(0) = n(0) + 1
  11.     End If
  12.     xD(A) = 1
  13. 101: Next
  14. Range("C" & i) = n(0)
  15. Range("D" & i) = n(1)

  16. Next
  17. End Sub
½Æ»s¥N½X


¦^´_  starry1314


...
­ã´£³¡ªL µoªí©ó 2015-11-10 16:33

TOP

        ÀR«ä¦Û¦b : §Ú­Ì­n°µ¦nªÀ·|ªºÀô«O¡A¤]­n°µ¦n¤º¤ßªºÀô«O¡C
ªð¦^¦Cªí ¤W¤@¥DÃD