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

½Ð°Ý¦r¦ê­n¦p¦ó²Î­p¦¸¼Æ¤£­«´_?

½Ð°Ý¦r¦ê­n¦p¦ó²Î­p¦¸¼Æ¤£­«´_?

¥»©«³Ì«á¥Ñ oiggu ©ó 2010-7-24 12:47 ½s¿è

½Ð°Ý¦r¦ê­n¦p¦ó²Î­p¦¸¼Æ¤£­«´_

¦r¦ê²Î­p.JPG (54.67 KB)

¦r¦ê²Î­p.JPG

¦r¦ê²Î­p.zip (2.35 KB)

oiggu

­Ó¤H«Øij
±Ä¥Î¦X¨Ö·Jºâ¸ò¼Ï¯Ã¤ÀªRªí
³£¬O§Ö³t¦³®Ä¤èªk
300 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2010-7-29 22:26 ½s¿è

¦^´_ 10# oiggu
¥i¨£§A¹ïµ{¦¡½X¨Ã¥¼¯u¥¿¤F¸Ñ§t·N
ªp¥B³oºØ²Î­p¥Î¼Ï¯Ã¤ÀªR«Ü§Ö´N¯à¸Ñ¨M
«Øij§A¥ý§âEXCEL°ò¥»¥\¯à¤F¸Ñ
VBA¬O»²§U¤u¨ã
¦³¤F°ò¥»¾Þ§@ªº°ò¦,VBAªº¹B¥Î¤~·|ÆF¬¡

    test.rar (16.58 KB)
  1. Sub nn()
  2. Dim A As Range, B As Range
  3. Set d = CreateObject("Scripting.Dictionary")
  4. With Sheets("DATE")
  5.    For Each A In .Range(.[B1], .[B1].End(xlToRight))
  6.       For Each B In .Range(.[A2], .[A2].End(xlDown))
  7.          d(A & B) = d(A & B) + Val(.Cells(A.Column, B.Row))
  8.       Next
  9.    Next
  10. End With
  11. With Sheets("A")
  12.    For Each A In .Range(.[B1], .[B1].End(xlToRight))
  13.       For Each B In .Range(.[A3], .[A3].End(xlDown))
  14.          .Cells(A.Column, B.Row) = d(A & B)
  15.       Next
  16.    Next
  17. End With

  18. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 10# oiggu
  1. Sub Ex()
  2.     Dim D As Range, R As Range, M$
  3.     Set D = CreateObject("Scripting.Dictionary")
  4.     With Sheets("date")
  5.         For Each R In .Range("b2", .Cells(.[a1].End(xlDown).Row, .[a1].End(xlToRight).Column))
  6.             M = .Cells(R.Row, 1) & .Cells(1, R.Column)
  7.             D(M) = D(M) + R
  8.         Next
  9.     End With
  10.     With Sheets("A")
  11.         For Each R In .Range("b3", .Cells(.[a3].End(xlDown).Row, .[a1].End(xlToRight).Column))
  12.             M = .Cells(R.Row, 1) & .Cells(1, R.Column)
  13.             R = D(M)
  14.         Next
  15.     End With
  16. End Sub
½Æ»s¥N½X

TOP

¦^´_ 9# oiggu

Sub sum()
For k = 2 To 10
Set d = CreateObject("Scripting.Dictionary")
With Sheets("date")
For Each a In Sheets("date").Range(.[a3], .[a65536].End(xlUp))
   d(a) = d(a) + a.Offset(, k - 1)
Next
For Each a In Sheets("a").Range([a3], [a65536].End(xlUp))
      Sheets("a").Cells(a.Row, k) = d(a)
    Next
End With
Next
End Sub

·PÁªO¥D
¤£¾å±o¨ºùØ¥X¿ù¡B ´ú¸Õ¥X¨Óªº­È=0 ¤£¥¿½T
½Ð°Ý Sheets("a").Cells(a.Row, k) = d(a) ¿ù¦b¨ºùØ?
oiggu

TOP

[ª©¥DºÞ²z¯d¨¥]
  • Hsieh(2010-7-27 18:57): À³¸Ó¹ï¤W­z§Þ¥©¥[¥H¤F¸Ñ,¦Û¤v¹Á¸Õ«á¦A°w¹ï°ÝÃDµo°Ý

¦^´_ 8# Hsieh


·PÁ¶W¯Åª©¥D
§A¼gªº vba ²¼ä¦³¤O¡A¤w¸g¥i¥H²Î­p¦¸¼Æ¨Ï¥Î¥¿±`¡A
ÁٽбФ@­Ó°ÝÃD¡A¦p¦ó§â¦P¦WºÙªº¼Æ¦rÁ`­p°_¨Ó¡B
¹ï·Ó §÷®Æ¶µ¥Ø¤ÀÃþ­pºâ¡A¦A¥Î VBA ¶×¤J®æ¦¡­n¦p¦ó§@?

test.zip (3.29 KB)

oiggu

TOP

¦^´_ 7# oiggu
  1. Sub MyCount()

  2. Set d = CreateObject("Scripting.Dictionary")
  3. Set d1 = CreateObject("Scripting.Dictionary")

  4. With Sheet1

  5. For Each a In .Range(.[A1], .[A65536].End(xlUp))
  6. d1(Left(a, 5)) = d1(Left(a, 5)) + Application.Sum(a.Offset(, 1).Resize(, 3))
  7.    If d(Left(a, 5)) = "" Then

  8.       d(Left(a, 5)) = a

  9.       ElseIf InStr(d(Left(a, 5)), a) = 0 Then

  10.       d(Left(a, 5)) = d(Left(a, 5)) & "," & a

  11.     End If

  12. Next

  13. For Each a In .[F5:F7]

  14.    For Each b In .[G3:L3]
  15.       
  16.      If (b.Column Mod 2) = 1 Then Cells(a.Row, b.Column) = UBound(Split(d(a & b), ",")) + 1
  17.      If (b.Column Mod 2) = 0 Then Cells(a.Row, b.Column) = d1(a & b)

  18.     Next

  19. Next

  20. End With

  21. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ oiggu ©ó 2010-7-26 06:29 ½s¿è

ÁÂÁ¶W¯Åª©¥D¡A¤Ó¯«¤F¡C
¤w¸g¥i¥H²Î­p¦¸¼Æ
½Ð°Ý­n¦p¦ó¥ÎVBA§âª÷ÃB²Î­p¥X¨Ó
©ñ¤J®æ¦¡¤º¡B¦r¦ê¶}ÀY+¦~¤ë²Î­p

²Î­p.JPG (99.92 KB)

²Î­p.JPG

²Î­p.zip (9.51 KB)

oiggu

TOP

¦^´_ 5# oiggu
  1. Sub MyCount()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. With Sheet1
  4. For Each a In .Range(.[A1], .[A65536].End(xlUp))
  5.    If d(Left(a, 5)) = "" Then
  6.       d(Left(a, 5)) = a
  7.       ElseIf InStr(d(Left(a, 5)), a) = 0 Then
  8.       d(Left(a, 5)) = d(Left(a, 5)) & "," & a
  9.     End If
  10. Next
  11. For Each a In .[C3:C5]
  12.    For Each b In .[D2:F2]
  13.       .Cells(a.Row, b.Column) = UBound(Split(d(a & b), ",")) + 1
  14.     Next
  15. Next
  16. End With
  17. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

ÁÂÁ¦U¦ì:
¸g´ú¸Õ³£¥i¥H¨Ï¥Î¡A¦ý¹J¨ì¤@­Ó°ÝÃD¸ê®Æ¦³5000µ§·|¼vÅT°õ¦æ³t«×·|«D±`摱
½Ð°Ý¬O§_¥i§ïvba ¦A¶×¤J®æ¤l¥[§Ö°õ¦æ³t«×¡C
oiggu

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD