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

[µo°Ý] 2­Ó±ø¥óªº¥[Á`

¦^´_ 1# yliu
¦³¦Ò¼{ª½±µ¥Î¼Ï¯Ã¤ÀªRªí¶Ü?
a.gif

TOP

¦^´_ 2# kimbal
ÁÂÁÂkimbal.
¦ý¥X²{°õ¦æ¶¥¬q¿ù»~¡¦13¡¦: «¬ºA¤£²Å¦X
°»¿ù¦b: With Sheets("Á`ªí").Cells(lngVlookupRow, lngCurrenMonth + 1) '©ñ¼Æ¾Ú¨ìÁ`ªí¤W
learner

TOP

¥»©«³Ì«á¥Ñ kimbal ©ó 2013-5-31 01:40 ½s¿è

¦^´_ 1# yliu
  1. Private Sub CommandButton2_Click()
  2. Application.ScreenUpdating = False
  3. Application.Calculation = xlCalculationManual

  4. Dim rowcnt As Long
  5. Dim i As Long

  6. Dim lngVlookupRow As Long
  7. Dim lngCurrenMonth As Long
  8. Dim lngCurrValue As Long

  9. '²M²z¼ƾÚ
  10. Sheets("Á`ªí").Activate
  11. Sheets("Á`ªí").Range("A3").CurrentRegion.Offset(1, 1).Clear


  12. Sheets("­ì©l¸ê®Æ").Activate
  13. With Sheets("­ì©l¸ê®Æ")
  14.     rowcnt = .Cells(1, 1).CurrentRegion.Rows.Count
  15.     For i = 1 To rowcnt
  16.         lngCurrenMonth = 0
  17.         If IsDate(.Cells(i, 2)) Then
  18.             lngCurrenMonth = Month(.Cells(i, 2)) '·í¦æ¤ë¥÷
  19.         End If
  20.         If lngCurrenMonth > 0 And Not (IsError(Application.Match(.Cells(i, 1), Sheets("Á`ªí").Range("A:A"), 0))) Then
  21.             lngVlookupRow = Application.Match(.Cells(i, 1), Sheets("Á`ªí").Range("A:A"), 0) '·í¦æÃþ«¬¦bÁ`ªí¦æ¼Æ
  22.             lngCurrValue = .Cells(i, 3)
  23.             With Sheets("Á`ªí").Cells(lngVlookupRow, lngCurrenMonth + 1) '©ñ¼Æ¾Ú¨ìÁ`ªí¤W
  24.                 .Value = .Value + lngCurrValue
  25.             End With
  26.         End If
  27.     Next
  28.    
  29. End With

  30. Application.Calculation = xlCalculationAutomatic
  31. Application.ScreenUpdating = True
  32. End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        ÀR«ä¦Û¦b : ¤£©È¨Æ¦h¡A¥u©È¦h¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD