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

«zÀY¤jÅo!«¢«¢!!

¦^´_ 1# myleoyes
  1. Sub Ex()
  2.     Dim R%
  3.     If ActiveCell.Column >= 3 And ActiveCell.Column <= 15 Then
  4.         If ActiveCell.Column Mod 2 > 0 Then
  5.             R = (ActiveCell.Row - 2) Mod 12
  6.             If R >= 0 And R <= 11 Then
  7.                 ActiveCell.Copy Cells(2, ActiveCell.Column)
  8.                 Cells(2, ActiveCell.Column + 1) = ActiveCell.Offset(12, 1) - ActiveCell.Offset(, 1)
  9.             End If
  10.         End If
  11.     End If
  12. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-6-26 19:59 ½s¿è

¦^´_ 3# myleoyes
Leov11  ¬O³sÄòªº½d³ò  Leov11-1 ¤¤¶¡¦³ÁôÂ꺽d³ò¬O¤£¦Pªº
  1. Sub Ex()
  2.     Dim R, A, C, Rng As Range, II%
  3.     If ActiveCell.Column >= 3 And ActiveCell.Column <= 15 Then
  4.         If ActiveCell.Column Mod 2 > 0 Then
  5.             R = (ActiveCell.Row - 5) Mod 12
  6.             If R >= 0 And R <= 11 Then
  7.                 ActiveCell.Copy Cells(2, ActiveCell.Column)
  8.                 Application.EnableEvents = False
  9.                 Set Rng = ActiveCell.EntireColumn.SpecialCells(xlCellTypeVisible)
  10.                 For Each C In Rng.Areas
  11.                     For Each A In C.Cells
  12.                         If A.Row = ActiveCell.Row Then II = 1
  13.                         If II > 0 Then II = II + 1
  14.                         If II = 14 Then
  15.                             Cells(2, ActiveCell.Column + 1) = ActiveCell.Offset(, 1) - A.Offset(, 1)
  16.                             Application.EnableEvents = True
  17.                             Exit Sub
  18.                         End If
  19.                     Next
  20.                 Next
  21.             End If
  22.         End If
  23.     End If
  24. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# myleoyes
Cells(2, ActiveCell.Column + 1) = Val(ActiveCell.Offset(, 1)) - Val(A.Offset(, 1))

TOP

        ÀR«ä¦Û¦b : ÀR§¤±`®¦¤v¹L¡B¶¢½Í²ö½×¤H«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD