Board logo

¼ÐÃD: ½Ð°Ý¦r¦ê­n¦p¦ó²Î­p¦¸¼Æ¤£­«´_? [¥´¦L¥»­¶]

§@ªÌ: oiggu    ®É¶¡: 2010-7-24 12:23     ¼ÐÃD: ½Ð°Ý¦r¦ê­n¦p¦ó²Î­p¦¸¼Æ¤£­«´_?

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

½Ð°Ý¦r¦ê­n¦p¦ó²Î­p¦¸¼Æ¤£­«´_
§@ªÌ: kimbal    ®É¶¡: 2010-7-24 16:27

¥»©«³Ì«á¥Ñ kimbal ©ó 2010-7-24 16:31 ½s¿è

¦bd3 ©ñ¤W³o­Ó¤½¦¡:
  1. =SUMPRODUCT((MID($A$1:$A$30,2,4)=D$2&"")*(LEFT($A$1:$A$30,1)=$C3)*($A$1:$A$30<>"")/COUNTIF($A$1:$A$30,$A$1:$A$30))
½Æ»s¥N½X
µM«á§Û¨ì¨ä¥L®æ
§@ªÌ: Hsieh    ®É¶¡: 2010-7-24 17:01

¦^´_ 1# oiggu
¿ï¨úd3Àx¦s®æ,¥[¤J©w¸q¦WºÙx
¤½¦¡=OFFSET(Sheet1!$A:$A,,,COUNTA(Sheet1!$A:$A),)
[attach]1955[/attach]
d3°}¦C¤½¦¡
{=IF(ISNUMBER(MATCH($C3&D$2,LEFT(x,5),0)),SUM(1/COUNTIF(OFFSET($A$1,MATCH($C3&D$2,LEFT(x,5),0)-1,,COUNTIF(x,"="&$C3&D$2&"*")),OFFSET($A$1,MATCH($C3&D$2,LEFT(x,5),0)-1,,COUNTIF(x,"="&$C3&D$2&"*")))),0)}
¦V¤U¦V¥k½Æ»s
§@ªÌ: gong    ®É¶¡: 2010-7-24 17:06

¥»©«³Ì«á¥Ñ gong ©ó 2010-7-24 17:08 ½s¿è

d3=SUMPRODUCT((LEFT($A$1:$A$30,5)=$C3&D$2)*1/COUNTIF($A$1:$A$30,$A$1:$A$30))
§@ªÌ: oiggu    ®É¶¡: 2010-7-24 18:25

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

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

§@ªÌ: oiggu    ®É¶¡: 2010-7-25 01:05

¥»©«³Ì«á¥Ñ 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
§@ªÌ: Hsieh    ®É¶¡: 2010-7-25 20:52

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

§@ªÌ: oiggu    ®É¶¡: 2010-7-26 06:36

¦^´_ 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¦ó§@?
§@ªÌ: oiggu    ®É¶¡: 2010-7-29 19:03

¦^´_ 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¨ºùØ?
§@ªÌ: GBKEE    ®É¶¡: 2010-7-29 19:35

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

§@ªÌ: Hsieh    ®É¶¡: 2010-7-29 19:51

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

    [attach]2063[/attach]
[attach]2069[/attach]
  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

§@ªÌ: zz5151353    ®É¶¡: 2010-7-31 20:18

­Ó¤H«Øij
±Ä¥Î¦X¨Ö·Jºâ¸ò¼Ï¯Ã¤ÀªRªí
³£¬O§Ö³t¦³®Ä¤èªk




Åwªï¥úÁ{ ³Â»¶®a±Ú°Q½×ª©ª© (http://forum.twbts.com/)