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

[µo°Ý] (¤w¸Ñ¨M)­pºâ³Ìªñ¤@¦¸º¦¶^»ù´T«×

[µo°Ý] (¤w¸Ñ¨M)­pºâ³Ìªñ¤@¦¸º¦¶^»ù´T«×

¥»©«³Ì«á¥Ñ freeffly ©ó 2012-2-22 17:00 ½s¿è

¦pªþÀÉ
§Ú·Q¥Î³Ì·sªº¤ë¥÷(¥Î¤ë¥÷¨º¤@¦C§PÂ_¡AÁÙ¨S¨ìªº¤ë¥÷¤£·|Åã¥Ü)
»P«e¤@¦¸¥æ©öªº¤ë¥÷ªº»ù®æ§@­pºâ
½Ð°Ý³o¦U­n«ç»ò¼g?

³Ìªñ¤@¦¸»ù®æ¥æ©öº¦¶^´T«×.rar (2.12 KB)
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

  1. Sub nn()
  2.   Dim lRow As Long
  3.   
  4.   lRow = Rows.Count
  5.   Do Until lRow = 1
  6.     lRow = Cells(lRow, 13).End(xlUp).Row
  7.     If Cells(lRow, 12) <> 0 And Cells(lRow, 12) <> "" Then
  8.       Cells(lRow, 14) = (Cells(lRow, 13) - Cells(lRow, 12)) / Cells(lRow, 12)
  9.     Else
  10.       Cells(lRow, 14) = (Cells(lRow, 13) - Cells(lRow, Cells(lRow, 13).End(xlToLeft).Column)) / Cells(lRow, Cells(lRow, 12).End(xlToLeft).Column)
  11.     End If
  12.     lRow = lRow - 1
  13.   Loop
  14. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# luhpro


    ³o¦U¤è¦¡¥i¥H
      ¤£¹L§Ú·Q°Ý¤@¤U¦pªG³Ìªñ¤@¦¸¤£¬O¦b³Ì«á¤@Äæ
      ³oºØ¤è¦¡­n¦p¦ó§ï?
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-7-29 20:25 ½s¿è

¦^´_ 3# freeffly
  1. Sub Ex()
  2. Dim C() As Integer, i As Integer, ii As Integer
  3. For i = 2 To Cells(Rows.Count, "M").End(xlUp).Row
  4. '°j°é ±q²Ä2¦C¶}©l  ¨ì(To)  MÄæ³Ì©³ºÝ(Rows.Count) ©¹¤W¨ì¦³¸ê®Æ(End(xlUp))ªº¦C¸¹
  5.     If Application.CountA(Cells(i, "B").Resize(, 12)) >= 2 Then 'BÄæResize(ÂX¥R)12Äæ: ¨ìMÄæ
  6.         ReDim C(1) As Integer                    '­«·s«Å§i°}¦C
  7.         For ii = 13 To 2 Step -1                  '°j°é ¶¡¹j(Step) -1 :¥Ñ¤j©¹¤p (¤U)
  8.             If Cells(i, ii) <> "" Then
  9.                 If (C(0)) = 0 Then
  10.                     C(0) = Cells(i, ii)
  11.                 ElseIf C(1) = 0 Then
  12.                     C(1) = Cells(i, ii)
  13.                 End If
  14.                 If C(0) <> 0 And C(1) <> 0 Then   '§ä¨ì³Ì±µªñªº¨â¼Æ
  15.                     Cells(i, "N") = (C(0) - C(1)) / C(1)
  16.                     Exit For
  17.                 End If
  18.             End If
  19.         Next
  20.     End If
  21. Next
  22. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2011-6-28 22:09 ½s¿è

¦^´_ 3# freeffly
¨º´NÅܦ¨±q³Ì¥½¤@¦C¨ì²Ä¤G¦C³£­n°õ¦æ.
µM«á¥ý§PÂ_ 12 ¤ë¨ºÄæ¬O§_¦³¸ê®Æ,
­Y¦³«h°õ¦æ­ì¥ýµ{¦¡¤¤ªº¨º­Ó¤ù¬q,
­YµL«h©¹¥ª´M§ä³Ì¥½¨âµ§¸ê®Æ,
­Y¦¹¨âµ§¸ê®Æ¨ä¤¤¤@µ§¦b A Äæ«h¤£°µ¥ô¦ó­pºâ, (¦] A Äd¤£¬O§Ú­Ì­n­pºâªº¸ê®Æ)
§_«h´N±N¦¹¨âÄæ¸ê®Æ°µ¬ÛÀ³ªº­pºâ, µ{¦¡¦p¤U:
  1. Sub nn()
  2.   Dim iCol1%, iCol2%
  3.   Dim lRows As Long, lRow As Long
  4.   
  5.   lRows = Cells(Rows.Count, 1).End(xlUp).Row
  6.   For lRow = lRows To 2 Step -1
  7.     If Cells(lRow, 13) <> 0 And Cells(lRow, 13) <> "" Then
  8.       If Cells(lRow, 12) <> 0 And Cells(lRow, 12) <> "" Then
  9.         Cells(lRow, 14) = (Cells(lRow, 13) - Cells(lRow, 12)) / Cells(lRow, 12)
  10.       Else
  11.         Cells(lRow, 14) = (Cells(lRow, 13) - Cells(lRow, Cells(lRow, 13).End(xlToLeft).Column)) / Cells(lRow, Cells(lRow, 12).End(xlToLeft).Column)
  12.       End If
  13.     Else
  14.       iCol1 = Cells(lRow, 13).End(xlToLeft).Column
  15.       iCol2 = Cells(lRow, iCol1).End(xlToLeft).Column
  16.       If iCol1 <> 1 And iCol2 <> 1 Then
  17.         Cells(lRow, 14) = (Cells(lRow, iCol1) - Cells(lRow, iCol2)) / Cells(lRow, iCol2)
  18.       End If
  19.     End If
  20.   Next lRow
  21. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# luhpro


    ¬Ý°_¨Ó¬Û·í½ÆÂø³á
        ÁÂÁ¤j¤j¦^ÂÐ
        ¥ý¦¬¤U¨Ó¬ã¨s
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 4# GBKEE


    ÁÂÁ¤j¤j¦^ÂÐ
      ¤@¼Ë¥ý¦¬¤U¨Ó¸Õ¸Õ¬Ý
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 4# GBKEE


    ¨â¦ìªº¤è¦¡³£¥i¥H°õ¦æ
       ¤£¹L¤j¤jªº¤è¦¡¤ñ¸û²³æ¤@ÂI
      ¦³¤@¨Ç¤è¦¡¨S¥Î¹L
      ¤£ª¾¹D¤j¤j¥i¥H¤j²¤Á¿¸Ñ¤@¤U¶Ü
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 4# GBKEE

ÁÂÁ¤j¤jµù¸Ñ

ReDim C(1) As Integer                    '­«·s«Å§i°}¦C

½Ð°Ý³o¸Ì¬°¤°»ò­n­«·s«Å§i?
­«·s«Å§i®ÉC()¸Ì­±©ñ1©Î0¦³¨S¦³®t?
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¦^´_ 9# freeffly
If Application.CountA(Cells(i, "B").Resize(, 12)) >= 2 Then 'BÄæResize(ÂX¥R)12Äæ: ¨ìMÄæ
¤W¦¡ ¬OÀˬd ¨ì¦³2­Ó¼Æ¦r¥H¤W
        ReDim C(1) As Integer        '­«·s«Å§i°}¦C   ->Âk¹s    C(0), C(1) ³]©w³Ì¥kÃä³Ì±µªñªº2­Ó¼Æ¦r

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD