- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
        
|
¦^´_ 1# wiemanson - Option Explicit
- Sub Ex()
- Dim x As Integer, S As Variant, AR(), AC()
- With ActiveSheet
- AC = Array("¬õ", "ºñ", "ÂÅ", "¶À") 'ÃC¦â°}¦C: «ü©wÃC¦â(0-3),ÃC¦â¥i¦A¼W¥[(0-?)
- AR = Array("E3", "F3", "G3", "H3", "I3") 'ÃC¦â¦ì¸m°}¦C (¬õ,ºñ,ÂÅ,¶À,Á`«¶q): Àx¦s®æªº¦ì¸m(0-4)
- 'Á`«¶q¦ì¸m :UBound(AR) -> ÃC¦â¦ì¸m°}¦Cªº¯Á¤ÞÈ
- .Range(AR(0) & ":" & AR(UBound(AR))) = ""
- x = 2
- Do While .Cells(x, 1) <> ""
- If .Cells(x, 4) = "·s" Then
- S = UBound(AR) '
- .Range(AR(S)) = .Range(AR(S)) + Cells(x, 2)
- Else
- S = Mid(.Cells(x, 1), 1, 1) '¦p¬õ¬õ®É¥iŪ¨ú"¬õ"
- If .Cells(x, 3) = "¤j" Then S = "ºñ"
- S = Application.Match(S, AC, 0) 'Match ¦p§ä¤£¨ì:¶Ç¦^¿ù»~È
- If IsNumeric(S) Then 'S: ¦b«ü©wÃC¦â°}¦C¤¤ªº¦ì¸m
- .Range(AR(S - 1)) = .Range(AR(S - 1)) + .Cells(x, 2)
- End If
- End If
- x = x + 1
- Loop
- S = UBound(AR)
- .Range(AR(S)) = .Range(AR(S)) + Application.Sum(.Range(AR(0) & ":" & AR(S - 1)))
- End With
- End Sub
½Æ»s¥N½X- Sub aa()
- Dim x As Integer, sum1 As Long, sum2 As Long, sum3 As Long, sum4 As Long, sum5 As Long, sum6 As Long
- x = 2
- sum1 = 0
- sum2 = 0
- sum3 = 0
- sum4 = 0
- sum5 = 0
- Do While Cells(x, 1) <> ""
- If Cells(x, 4) = "·s" Then
- sum5 = sum5 + Cells(x, 2).Value
- ElseIf Cells(x, 1) = "¬õ" Then
- sum1 = sum1 + Cells(x, 2).Value
- ElseIf Cells(x, 1) = "¬õ¬õ" Then
- sum1 = sum1 + Cells(x, 2).Value
- ElseIf Cells(x, 1) = "ºñ" Or Cells(x, 3) = "¤j" Then
- sum2 = sum2 + Cells(x, 2).Value
- ElseIf Cells(x, 1) = "ÂÅ" Then 'Cells(x, 3) !!!
- sum3 = sum3 + Cells(x, 2).Value
- ElseIf Cells(x, 1) = "¶À" Then 'Cells(x, 3) !!!
- sum4 = sum4 + Cells(x, 2).Value
- End If
- x = x + 1
- Loop
- Cells(3, 5) = sum1
- Cells(3, 6) = sum2
- Cells(3, 7) = sum3
- Cells(3, 8) = sum4
- Cells(3, 9) = sum5 + sum1 + sum2 + sum3 + sum4
- End Sub
½Æ»s¥N½X |
|