- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¦^´_ kimbal
ÁÂÁÂkimbal.
¦ý¥X²{°õ¦æ¶¥¬q¿ù»~¡¦13¡¦: «¬ºA¤£²Å¦X
°»¿ù¦b: With Sheets("Á`ªí").Cells( ...
yliu µoªí©ó 2013-5-31 12:30
¦^´_ 2# kimbal
¤£¦n·N«ä¡A§Úµy·L²K¥[¤F´X¦æ¡A§Æ±æ±zµ¥¯à¯º¯Ç¡I- Private Sub Ex()
- Dim rowcnt As Long, i As Long
- Dim lngVlookupRow As Long, lngCurrenMonth As Long, lngCurrValue As Long
- Application.ScreenUpdating = False
- Application.Calculation = xlCalculationManual
- ' ²M²z¼ƾÚ
- Sheets("Á`ªí").Activate
- Sheets("Á`ªí").Range("A3").CurrentRegion.Offset(1, 1).Clear
- Sheets("ì©l¸ê®Æ").Activate
- With Sheets("ì©l¸ê®Æ")
- rowcnt = .Cells(1, 1).CurrentRegion.Rows.Count
- For i = 2 To rowcnt
- lngCurrenMonth = 0
- If IsDate(.Cells(i, 2)) Then
- lngCurrenMonth = Month(.Cells(i, 2)) ' ·í¦æ¤ë¥÷
- End If
-
- If lngCurrenMonth > 0 And Not (IsError(Application.Match(.Cells(i, 1), Sheets("Á`ªí").Range("A:A"), 0))) Then
- lngVlookupRow = Application.Match(.Cells(i, 1), Sheets("Á`ªí").Range("A:A"), 0) ' ·í¦æÃþ«¬¦bÁ`ªí¦æ¼Æ
- lngCurrValue = .Cells(i, 3)
- With Sheets("Á`ªí")
- .Cells(lngVlookupRow, lngCurrenMonth + 1).Value = .Cells(lngVlookupRow, lngCurrenMonth + 1).Value + lngCurrValue ' ©ñ¼Æ¾Ú¨ìÁ`ªí¤W
- .Cells(lngVlookupRow, "N") = .Cells(lngVlookupRow, "N") + lngCurrValue
- .Cells(lngVlookupRow, Chr(79 + Int(lngCurrenMonth / 4))) = .Cells(lngVlookupRow, Chr(79 + Int(lngCurrenMonth / 4))) + lngCurrValue
- End With
- End If
- Next
- End With
-
- With Sheets("Á`ªí")
- rowcnt = .[A3].End(xlDown).Row
- For i = 2 To 18
- .Cells(rowcnt, i) = WorksheetFunction.Sum(.Range(Chr(64 + i) & 4 & ":" & Chr(64 + i) & (rowcnt - 1)))
- Next i
- End With
-
- Application.Calculation = xlCalculationAutomatic
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|