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

¦p¦ó§Q¥ÎVBAIJµoÀx¦s®æ²£¥Í¤é´Á.®É¶¡

¦p¦ó§Q¥ÎVBAIJµoÀx¦s®æ²£¥Í¤é´Á.®É¶¡

½Ð±Ð¦Ñ®v­Ì¦p¦ó¦b¤u§@ªíIJµoÀx¦s®æ«á¡A¹ïÀ³ªºÄæ¦ì²£¥Í¤é´Á.®É¶¡
1.BÄæ¿é¤J¤å¦r«á¡A¢ìÄæ¹ïÀ³Äæ¦ì´NÅã²{¤é´Á.®É¶¡¡ABÄæ¨S¿é¤J¡A
   DÄæ¹ïÀ³Äæ¦ì´N¤Ï¥Õ¡C
2.CÄæ¿é¤J¤å¦r«á¡AEÄæ¹ïÀ³Äæ¦ì´NÅã²{¤é´Á.®É¶¡¡ACÄæ¨S¿é¤J¡A
   EÄæ¹ïÀ³Äæ¦ì´N¤Ï¥Õ¡C
3.FÄ欰¦X­p­pºâ®É¶¡Äæ¦ì¡C

ÁÂÁ¦Ѯv­ÌÀ°¦£¡I
ªþÀÉ: 20160108.rar (16.42 KB)

¦^´_ 13# yen956


  ÁÂÁÂyen956¤j¤jªºÀ°¦£¡A¯uªº«Ü¦n¥Î¡A¤]ÁÂÁÂML089¤j¤j¡A·PÁÂ^^

TOP

¦^´_ 12# man65boy
¸Õ¸Õ¬Ý:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Lst As Integer, r As Integer, Rng As Range
    Lst = [A65536].End(xlUp).Row    '¨ú±o ÄæA ³Ì¤U­±«DªÅ¥Õ®æªº¦C¸¹
    Set Rng = [B2].Resize(Lst - 1, 4)   '³]©wWorksheet_ChangeIJ°Ê½d³ò¬°[B2:Dxx], xx=Lst(¦C¸¹)
    If Target.Count > 2 Then Exit Sub   '¦pªG¤@¦¸§ïÅܦh®æ«h¨S§@¥Î
    If Intersect(Target, Rng) Is Nothing Then Exit Sub   '¦pªG§ïÅܪºÀx¦s®æ¤£¦b¹w­p½d³ò¤º«h¨S§@¥Î
    r = Target.Row
    '¦pªG§ïÅܪºÀx¦s®æ¬O BÄæ ©Î CÄæ, «h
    If Target.Column = 2 Or Target.Column = 3 Then
        '¡¹¦pªG Target ¬°ªÅ¥Õ, «h
        If Target = "" Then
            Target.Offset(0, 2) = ""                      '²M°£¦P¦C¥kÃä¨âÄ檺Cell
            Target.Offset(0, 2).Interior.ColorIndex = 35  '¨Ã¤Ï¥Õ
            Target.Cells(r, 6) = ""              '¨Ã²M°£¦P¦Cªº[Fxx]
        '¡¹§_«h
        Else
            '¦pªG¦P¦C¥kÃä¨âÄ檺Cell¬°ªÅ¥Õ, «h¶ñ¤J²{¦b®É¶¡, ¤£¬OªÅ¥Õ, «h¤£¶ñ
            If Target.Offset(0, 2) = "" Then
                Target.Offset(0, 2) = Now                         '¶ñ¤J²{¦b®É¶¡
                Target.Offset(0, 2).Interior.ColorIndex = xlNone  '¥B¨ú®ø¤Ï¥Õ
            End If
        End If
    End If
        
    '¦pªG °_©l®É¶¡ ¤Î µ²§ô®É¶¡ ¤£¬OªÅ¥Õ, «h¦b [Fxx] ­pºâ®É®t(¥H¤ÀÄÁ¬°³æ¦ì)
    If Application.Count(Cells(r, 4), Cells(r, 5)) = 2 Then
        Cells(r, 6) = Int((Cells(r, 5) - Cells(r, 4)) * 24 * 60)
    End If
End Sub

TOP

¦^´_ 11# yen956

   ©ç¨Æ¡A¤p§Ì¨S¼g©ú¥Õ!
    °²³]B5¿é¤J¤H­û«á¡AD5¶]¥X"°_©l®É¶¡"¡AC5¿é¤J¤H­û«á¡AE5¶]¥Xµ²§ô®É¶¡¡A¤§«áVBA»yªk¤w¸g§âF5°µ²Î­p¤F¡A§Ú¦bÀH·N§ó§ï°_©l®É¶¡D5¡AF5ªº²Î­p®É¶¡´N¤£·|¦A§ó§ï¤F¡A¬O³o­Ó·N«ä¡C

TOP

¦^´_ 7# man65boy
"¦ý¦pªG¤â°Ê§ó§ï®É¶¡ªº¸Ü¡A¦@­p"¤À"¥i§_¦P®É§ó§ï¼Æ¾Ú"
¬Ý¤£À´§Aªº»Ý¨D¬O¤°»ò?

TOP

¦^´_ 6# ML089
ÁÂÁ¤j¤jªº«ü¾É!!
¤×¨ä¬O¥Î
Range("F" & .Row) = "=IF(COUNT(RC4:RC5)=2,INT((RC5-RC4)*24*60),"""")"
ªº¨Ï¥Î, ¥i¥H²¤Æ¤£¤Ö If A and B then ... ªº¼gªk, «D±`¹ê¥Î, ¦¬¤U, ÁÂÁÂ

TOP

¦^´_ 8# man65boy

³o¬O ¬Û¹ï¦ì¸m¤½¦¡
Range("F" & .Row) = "=IF(COUNT(RC[-2]:RC[-1])=2,INT((RC[-1]-RC[-2])*24*60),"""")"

³o¬O µ´¹ï¦ì¸m¤½¦¡
Range("F" & .Row) = "=IF(COUNT(RC4:RC5)=2,INT((RC5-RC4)*24*60),"""")"
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 6# ML089


    ÁÂÁÂML089¤j¤jªº¦^µª¡Aµ¹¤p§Ì¦h¤F¤@¶µ¸ÑÃDªºµª®×!¯u·PÁÂ^^

TOP

¦^´_ 5# yen956

ÁÂÁÂyen956¤j¤jªº¦^µª¡A¦ý¦pªG¤â°Ê§ó§ï®É¶¡ªº¸Ü¡A¦@­p"¤À"¥i§_¦P®É§ó§ï¼Æ¾Ú¡AÁÂÁ§A!

TOP

¥»©«³Ì«á¥Ñ ML089 ©ó 2016-1-9 07:38 ½s¿è

¦^´_ 3# man65boy

FÄ檽±µ¥Î¤½¦¡±a¤J

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
      If .Count > 1 Then Exit Sub
      If Intersect(Union([B:B], [C:C]), .Cells) Is Nothing Then Exit Sub
      Application.EnableEvents = False
      .Offset(0, 2).Value = Now()
      Range("F" & .Row) = "=IF(COUNT(RC4:RC5)=2,INT((RC5-RC4)*24*60),"""")"
      Application.EnableEvents = True
End With
End Sub

¸É¥R¡G
³o¬O ¬Û¹ï¦ì¸m¤½¦¡
Range("F" & .Row) = "=IF(COUNT(RC[-2]:RC[-1])=2,INT((RC[-1]-RC[-2])*24*60),"""")"

³o¬O µ´¹ï¦ì¸m¤½¦¡
Range("F" & .Row) = "=IF(COUNT(RC4:RC5)=2,INT((RC5-RC4)*24*60),"""")"
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

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