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

½Ð°Ý....³o­Ó­n«ç»ò­×§ï

¦^´_ 1# color790
³oµ{§Ç­nªº¬O¬Æ»ò?  §Ú¬Ý¤£À´  ¥i¥H§i¶D§Ú¶Ü?
If Cells(i, 2) = TimeValue("09:30:00") And Cells(i, 1) = Cells(j, 16) Then     'aÄæ¬°¤é´Á,bÄæ¬°®É¶¡
§â¬õ¦â0¥h±¼ ´N·|°Ê

TOP

¦^´_ 3# color790
ªÑ²¼¤£¤ÓÀ´
  1. Sub aa()
  2. With Sheet1
  3.     For j = 2 To .Cells(Rows.Count, "P").End(xlUp).Row
  4.         For i = 2 To .Cells(Rows.Count, "A").End(xlUp).Row
  5.             If .Cells(i, "B") = TimeValue("9:30:00") And .Cells(i, "A") = .Cells(j, "P") Then     'aÄæ¬°¤é´Á,bÄæ¬°®É¶¡
  6.                 x = Application.Max(.Range(.Cells(i - 2, 4), .Cells(i, 4)))
  7.                 Z = Application.Min(.Range(.Cells(i - 2, 5), .Cells(i, 5)))
  8.                 Do Until .Cells(i, 4) > x + 30 And .Cells(i, 1) = .Cells(j, 16) Or .Cells(i, 5) < Z
  9.                     i = i + 1
  10.                 Loop
  11.                 If Cells(i, 5) < Z Then
  12.                     Set y = Cells(i, 5)
  13.                 Else
  14.                     Set y = Cells(i, 4)
  15.                 End If
  16.                 y.Offset(, 7) = y - x
  17.             End If
  18.         Next
  19.     Next
  20. End With
  21. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD