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

[µo°Ý] (¤v¸Ñ¨M!) ·Q½Ð±Ð¦U¦ì,¨º¤@ºØ¼gªk¤ñ¸û§Ö¤@ÂI? (·QÀu¤Æ¤@¤U)

[µo°Ý] (¤v¸Ñ¨M!) ·Q½Ð±Ð¦U¦ì,¨º¤@ºØ¼gªk¤ñ¸û§Ö¤@ÂI? (·QÀu¤Æ¤@¤U)

¥»©«³Ì«á¥Ñ StanleyVic ©ó 2011-8-9 14:50 ½s¿è

¦U¦ì¤j¤j¦n,¥»¤H·QÀu¤Æ¤@¤U¥N½X, ½Ð±Ð¦p¤U:
¦pªG§â¤½¦¡ : AN6 =IF(D6<>"",T6-AI6,"") ¼g¦¨ vba
1. ¥»¤H¦³´X¸U¦æ°O¿ý,©Ò¥H¼g¤F2ºØ¼gªk,·Q½Ð±Ð¨º¤@­Ó¤ñºØ¥i¥H¶]±o§Ö¤@ÂI?
   (¥i¥Hªº¸Ü..¸ÑÄÀ¤@¤U)
2. ¦p¦U¦ì¤j¤j¦³§ó¦nªº¼gªk,½Ð«ü±Ð.

====================================================
¼gªk (¤@)
Private Sub CommandButton12_Click()
Dim j,AA as integer
    Sheets("Status B Log").Activate
    For j = 6 To Range("A65536").End(xlUp).Row
        If Cells(j, "D") <> "" Then
           AA = Cells(j, "T") - Cells(j, "AI")
           Cells(j, "AN") = Application.WorksheetFunction.Round(AA, 2)
        Else
           Cells(j, "AN") = ""
        End If
    Next j
        ThisWorkbook.Save
        MsgBox (" Quoted vs Invoice ( Variance ) - OK !")
End Sub

------------
¼gªk (¤G)

Private Sub CommandButton12_Click()
Dim i As Integer
    Sheets("Status B Log").Activate
    For i = 6 To Range("D65536").End(xlUp).Row
        Cells(i, "AN").FormulaR1C1 = "=IF(RC[-36]<>"""",RC[-20]-RC[-5],"""")"
        Cells(i, "AN") = Round(Cells(i, "AN").Value, 2)
    Next i
        ThisWorkbook.Save
        MsgBox (" Quoted vs Invoice ( Variance ) - OK !")
End Sub
NeverTry , NeverNo !

¦^´_ 1# StanleyVic
§A¥i¦b¨â¼gªk ³]¥ß¤@ÅܼƬ°Time,µ{¦¡µ²§ô«e   MsgBox    Time-ÅܼƠ ´ú¸Õ­þ¤@¼gªk§Ö
¥t´£¨Ñ¤@¤£¥Î°j°éªº¸Ñªk
  1. Sub Ex()
  2.     Dim Rng As Range, T As Date
  3.     T = Time
  4.     With Sheets("Status B Log")
  5.         Set Rng = Range("D6", Range("D65536").End(xlUp))  'DÄæ¸ê®Æ½d³ò
  6.         Rng.Offset(, 36) = ""                             'NÄæ²M°£ (±NDÄ檺½d³ò¦ì²¾¨ìNÄ檺½d³ò)
  7.         Set Rng = Rng.SpecialCells(xlCellTypeConstants)   'DÄ榳¸ê®Æ½d³ò
  8.         With Rng.Offset(, 36)                             'DÄ榳¸ê®Æ½d³ò¦ì²¾¨ìNÄ檺½d³ò
  9.             .Value = "=Round(IF(RC[-36]<>"""",RC[-20]-RC[-5],""""),2)"
  10.             .Value = .Value
  11.         End With
  12.     End With
  13.     ThisWorkbook.Save
  14.     MsgBox (" Quoted vs Invoice ( Variance ) - OK !" & Chr(10) & "¦@¥Î®É: " & Format(Time - T, "HH:MM:SS"))
  15. End Sub
½Æ»s¥N½X

TOP

´X¸U¦æÀ³¸Ó¥Î°}¦C¤è¦¡
  1. Private Sub CommandButton1_Click()
  2. Dim j&, n&, d, t, ai, arr
  3. tm = Timer
  4.    With Sheets("Status B Log")
  5.    n = .Range("d65536").End(xlUp).Row
  6.    d = .Range("d6:d" & n)
  7.    t = .Range("t6:t" & n)
  8.    ai = .Range("ai6:ai" & n)
  9.    ReDim arr(1 To UBound(d), 0)
  10.     For j = 1 To n - 6
  11.         If d(j, 1) <> "" Then
  12.           arr(j, 0) = Application.WorksheetFunction.Round(t(j, 1) - ai(j, 1), 2)
  13.         End If
  14.     Next j
  15.     .Cells(6, "AN").Resize(UBound(d), 1) = arr
  16.     End With
  17.         ThisWorkbook.Save
  18.         MsgBox (" Quoted vs Invoice ( Variance ) - OK !") & "¥Î®É" & Timer - tm & "¬í"
  19. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-7-19 08:16 ½s¿è

¦^´_ 3# oobird¶Wª©
¬O§Aªº§Ö ¥uµ¹¤@¦¸­È          .Cells(6, "AN").Resize(UBound(d), 1) = arr
§Úªºµ{¦¡µ¹¤F¤G¦¸­È           .Value = "=Round(IF(RC[-36]<>"""",RC[-20]-RC[-5],""""),2)"
                                                  .Value = .Value
©ó§ÚªºPC¬ùºC¤F 0.078¬í   
PS : 2003 ¥Î Rows.Count ´ú¸Õ

TOP

¨þ¨þ¡I¨Ç·Lªº®t¶Z­Ë¬O¤£¥²¥h­p¸û
¥u¬O´£¨Ñ­Ó¤Hªº«ä¦Ò¤è¦V¨Ñ¼Ó¥D°Ñ¦Ò¡C

TOP

¥»©«³Ì«á¥Ñ StanleyVic ©ó 2011-7-19 11:39 ½s¿è

­º¥ý,¥»¤H¤Q¤À·PÁÂ"GBKEE" ©M "oobird" ªº¦^µª,
¯u·Q¤£¨ì..¤@­Ó¤½¦¡ AN6 =IF(D6<>"",T6-AI6,"")  ¦bvba ¤¤¥i¥H¤d¸U¸U¤Æ.
¦n. §Ú²{´NÁ`µ²¤@¤U : ¦pªG§Ú¤F¸Ñ¿ù,½Ð¦U¦ì¤j¤j«ü¥X.

§Úªº¼gªk1 ©M 2 ªº®É¶¡³£¤@¼Ë¬O 1.157407 ¬í.
¦ý¦pªG­n§Ú»¡§Ö, §Ú·|¿ï2, ¦]¬°1¤¤§Ú²Ó¤ß¬d¯uªº¦p GBKEE ©Ò»¡,§Ú°j¤F°é¤l.
¦]¬°¼gªk1·í¤¤, ¥i¥Hª½±µ§â AA ¥N¤J,¤£¥Î¦A¦h¤@¼h.©Ò¥H§Ú¼g 2·|¤ñ1 §Ö¤@ÂI.
AA = Cells(j, "T") - Cells(j, "AI")
Cells(j, "AN") = Application.WorksheetFunction.Round(AA, 2)

'----------------------------
¤èªk3 (GBKEE) ©M ¤èªk4 (oobird)
¦Ñ¹ê»¡,¤Ó¥O§Ú¾_Åå, §Úªº Åã¥Ü¬O 0¬í..
°ÝÃD :
1. ½Ð°Ý¤j¤j, §A­Ìªºformat ¬O¦p¦ó¼g¤~¯àºâ¥X ²@¬í ?
2. ½Ð°Ý¤èªk3(GBKEE) ¤¤ ¥H¤U³o¥y¥N½Xªº¥Î³B¬O¤°»ò ?
    Set Rng = Rng.SpecialCells(xlCellTypeConstants)   'DÄ榳¸ê®Æ½d³ò
   §Ú¤£©ú¥Õ¥¦ªº·N«ä..
NeverTry , NeverNo !

TOP

¥»©«³Ì«á¥Ñ StanleyVic ©ó 2011-7-19 12:30 ½s¿è

¦^´_ 3# oobird

¦^¤èªk¥| : "oobird" ±z¦n! §Aªº¤èªk¬O¥ý¥þ³£©w¸q¦n.¯à§Ö³t¶]§¹¥N½X.ÁÂÁ§Aªº«Øij.
¦ý¥»¤H¯uªº«Ü·s¤â..¤]¦³«Ü¦h¥N½Xªº¦a¤è,ÁÙ¥¼¤F¸Ñ³z.¦]·Q¦h¾Ç²ß....§Æ±æ§A¤£¤¶·N..¯à¬°§Ú¸ÑÄÀ¤@¤U.¸U¤À·PÁÂ.
¤@. ¥N½X¤¤ Dim j&, n&, d, t, ai, arr   ªº & ¬O¤°»ò®É·N«ä..?

   n = .Range("d65536").End(xlUp).Row
   d = .Range("d6:d" & n)
   t = .Range("t6:t" & n)
   ai = .Range("ai6:ai" & n)

¤G. ¥H¤W§Ú¤F¸Ñ¨ì¬O§A·Q¹w¥ý©w¸q¦n, ¤è«K¹B¦ævba ¤½¦¡ AN6 =IF(D6<>"",T6-AI6,"") ¦Ó«Ø¥ßªº
   ¥i¯à§Ú¹ï ReDim arr ¤£¤Ó¼ô©M¤£¤F¸Ñ,Åý§Ú¤U­±¤£¯à¸ÑŪ¤F.. (¥H¤Uºñ¦â¬O§Ú¤F¸Ñªº¦a¤è,¦p¦³¿ù½Ð§ó¥¿§Úªº«ä¦Ò)

   ReDim arr(1 To UBound(d), 0)                                                                       ' ¼Æ²Õ ¥Ñ¡@[D6:DN]    
    For j = 1 To n - 6                                                                                      ' °O¿ýªº¦æ¼Æ (¥u¦³¤º®eªº¦æ¼Æ 6~n)    
        If d(j, 1) <> "" Then                                                                               ' ¤½¦¡ùتº§PÂ_»y¥y.if(d6<>""    
          arr(j, 0) = Application.WorksheetFunction.Round(t(j, 1) - ai(j, 1), 2)             ' ³o¥y arr(j,0) ¤¤ªº 0 ¬O¤°»ò ?   
        End If
    Next j                                                                                                        
    .Cells(6, "AN").Resize(UBound(d), 1) = arr                                                       ' ¤£©ú¥Õ³o¥y¥N½X    
    End With

¦A¦¸Á¹L"oobird" ¨¯­W¤F.. !! :loveliness: :handshake
NeverTry , NeverNo !

TOP

¦^´_ 6# StanleyVic    ¦^´_ 7# StanleyVic
§AªººÃ°Ý½×¾Â¤w´£°Ý«Ü¦h¤F, ¤£¬O¤£¦^µª§A.«Øij§A¦h¬Ý ½×¾Â¸Ìªºµo°Ý.
´Á«Ý§A»¡:"§Ú¤F¸Ñ°Õ"

format ¬O¦p¦ó¼g¤~¯àºâ¥X ²@¬í ?
Timer (±q«e¤@­Ó¤È©]ºâ°_¨ì²{¦b©Ò¸g¹Lªº¬í¼Æ¬í¼Æ) »P Time(¨t²Î®É¶¡)   ¦³®t§O

TOP

¥»©«³Ì«á¥Ñ StanleyVic ©ó 2011-7-19 14:45 ½s¿è

¦^´_ 8# GBKEE

ÁÂÁÂ"GBKEE-ª©¥D"µ¹§Úªº·N¨£..
·PÁ§A¤Þ¾É¤F§Ú.. Ãö©óTimer ©M»PTime °Ï§O.
²{¦b§Ú¥i¥H¹ê²{¤F"²@¬í"ªº¥X²{.

¥t¥~ :
¤£©ú¥Õªº¦a¤è.......... §Ú.......
¦nªº..§Ú·|¦A¦h¦h¾Ç²ß.¼W±j¤@¤U¦Û¤vªº°ò¥»¥\.
ÁÂÁ§A¹ï§Ú­Ì·s¤Hªº´Á«Ý ^_^"
NeverTry , NeverNo !

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤H¤£©È¿ù¡A´N©È¤£§ï¹L¡A§ï¹L¨Ã¤£Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD