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

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

¦^´_ 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

¥»©«³Ì«á¥Ñ 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

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

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD