½Ð°Ý¦U¦ì°ª¤â,
§Ún±Nì©l¸ê®Æ¸Ì¨ÌÃþ§O»P¤é´Á³o¨âÓ±ø¥ó±Nª÷ÃB¥[Á`¨ì"Á`ªí",¨Ò¦p:1/1~1/31, AÃþª÷ÃB¥[Á`«á©ñ¨ìB4Àx¦s®æ,2/1~2/28, AÃþª÷ÃB¥[Á`«á©ñ¨ìC4Àx¦s®æ,3/1~3/31, AÃþª÷ÃB¥[Á`«á©ñ¨ìD4Àx¦s®æ..¥H¦¹Ãþ±À
쥻¨Ï¥Î¤u§@ªí¨ç¼ÆSUMPRODUCT, ¦ý¸ê®Æ¶q¦h®É,¤u§@ªírun«·spºâ·|ªá«Ü¦h®É¶¡, ·Q§ï¥ÎVBA¤è¦¡.
¦ý§Ú¥u·|¥Î¤U¦C¼gªk,µo²{³o¼Ë¼gªkn¼g«Ü¦hªºIF§PÂ_,·Q½Ð°Ý¦U¦ì°ª¤â ´£¨Ñ¸û¦nªº¼gªk.·PÁÂ!
Private Sub CommandButton2_Click()
Dim rowcnt As Integer
Dim i As Integer
Dim sum_A_1, sum_A_2, sum_A_3,sum_A_4,sum_A_5,sum_A_6,sum_A_7,sum_A_8,sum_A_9,sum_A_10,sum_A_11,sum_A_12 As Variant
sum_A_1= 0 '²ÎpAÃþ1¤ë¥÷ª÷ÃB
sum_A_2= 0 '²ÎpAÃþ2¤ë¥÷ª÷ÃB
sum_A_3= 0 '²ÎpAÃþ3¤ë¥÷ª÷ÃB
sum_A_4= 0 '²ÎpAÃþ4¤ë¥÷ª÷ÃB
sum_A_5= 0 '²ÎpAÃþ5¤ë¥÷ª÷ÃB
Sheets("ì©l¸ê®Æ").Activate
With Sheets("ì©l¸ê®Æ")
rowcnt= .Cells(1, 1).CurrentRegion.Rows.Count
For i = 1 To rowcnt
'¥[Á`AÃþ¤@¤ë¥÷ª÷ÃB
If .Cells(i,2) >= "2013/1/1"And .Cells(i, 2) <= "2013/1/31" And .Cells(i,1) = Sheets("Á`ªí").Range("A4") Then
sum_A_1= sum_A_1 + (Cells(i, 3).Value)
Sheets("Á`ªí").Range("B4") = sum_A_1
End If
'¥[Á`AÃþ¤G¤ë¥÷ª÷ÃB
If .Cells(i,2) >= "2013/2/1"And .Cells(i, 2) <= "2013/2/28" And .Cells(i,1) = Sheets("Á`ªí").Range("A4") Then
sum_A_2= sum_A_2+ (Cells(i, 3).Value)
Sheets("Á`ªí").Range("C4") = sum_A_2
End If
Next
End With
End Sub
|