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

[µo°Ý] ºâº¦¶^»P§¡»ù

[µo°Ý] ºâº¦¶^»P§¡»ù

¥»©«³Ì«á¥Ñ daniel5168 ©ó 2015-7-31 17:45 ½s¿è

½Ð±Ð¦U¦ì¥ý¶i,§Ú¥ÎDDE¬ö¿ý»ù¦ì,­n¦p¦ó¥i¥H¦P®É°O¿ý³o¤ÀÄÁ»P¤W¤ÀÄÁªºº¦¶^»P§¡»ù,©È¤f±ø¤£¦n¸ÑÄÀ¤£²M¥H¤Uªþ¹Ï

º¦¶^»P§¡»ù¤]¬O­n¨C¤ÀÄÁ©¹¤U¬ö¿ýªº,¨ºD2¸òE2ªº®æ¤l¸Ó«ç»ò¼g¤½¦¡
¥x«üªñ¤@¤ÀÄÁ§Y®É°O¿ý.rar (28.24 KB)

º¦¶^ªº©w¸qÀ³¸Ó¬O(³o¤ÀÄÁ¦¨¥æ»ù-¤W¤ÀÄÁ¦¨¥æ»ù)/¤W¤ÀÄÁ¦¨¥æ»ù
Kenny

TOP

¦^´_ 2# ken2192
¦ý¬O§Ú­n¦bD2¸òE2­pºâ¥X¨C¤ÀÄÁªºÅܤÆ,µM«á©¹¤U¨C¤ÀÄÁ¬ö¿ý,§Ú¤£ª¾¹D¸Ó¦p¦ó²{¦b»ù®æ«Ø¥h¤W¤@¤ÀÄÁ»ù®æ,¦]¬°¤W¤@¤ÀÄÁ»ù®æªºÀx¦s®æ¦ì¸m¤£¬q§ïÅÜ

TOP

¥»©«³Ì«á¥Ñ daniel5168 ©ó 2015-8-3 14:28 ½s¿è

½Ð°Ý¤@¤U¦U¦ì¥ý¶i,§Ú¤W­z·Qªk¬O¤£¬OµLªk°µ¨ì,¥u¯à¥ÎCÄæ¤w¸g°O¿ýªº¸ê®Æ¦bDÄæ¥H¤ÎEÄæ¥Î¨ç¼Æ­pºâ©O?
¦]©È¨ç¼Æ¤½¦¡¤Ó¦h·|¾É­P¶V¨Ó¶V¿ð¶w,©Ò¥H·Q°Ý°Ý¬O§_¦³¥i¯à¦bD2¥H¤ÎE2´N§â¼Æ¾Úºâ¥X¨Ó¦AÅýVBAªº¨C¤À¬ö¿ý¥h¼g¦bD3¸òE3©¹¤UÄæ¦ì

TOP

¦^´_ 4# daniel5168

¸Õ¸Õ¬Ý
  1. Sub ¦Û°Ê°O¿ý()
  2.     Dim Rng As Range, º¦¶^ As Single, §¡»ù As Single
  3.     If uMode = 0 Then Exit Sub
  4.     With Sht1
  5.         If Time > TimeValue(EndTime) Then '¦¬½L®É¶¡¥H«á¤£°õ¦æ
  6.             .[O8] = "¤w¹L¦¬½L"
  7.             uMode = 0
  8.             Exit Sub
  9.         End If
  10.         '----------------------------------------------------------
  11.         Set Rng = .Range("A65536").End(xlUp).Offset(1)
  12.         .Range("A" & Rng.Row & ":C" & Rng.Row).Value = .Range("A2:C2").Value
  13.         With .Cells(Rng.Row, "C")   '
  14.             'º¦¶^ªº©w¸qÀ³¸Ó¬O(³o¤ÀÄÁ¦¨¥æ»ù-¤W¤ÀÄÁ¦¨¥æ»ù)/¤W¤ÀÄÁ¦¨¥æ»ù
  15.             If .Row >= 4 Then º¦¶^ = (.Cells - .Cells.Offset(-1)) / .Cells.Offset(-1)
  16.             '20³æ¦ì¶g´Á§¡»ù
  17.             If .Row >= 22 Then §¡»ù = Application.WorksheetFunction.Average(.Cells.Offset(-19).Resize(20))
  18.         End With
  19.         .Range("D2") = IIf(º¦¶^ <> 0, º¦¶^, "")
  20.         .Range("E2") = IIf(§¡»ù <> 0, §¡»ù, "")
  21.         .Range("D" & Rng.Row & ":E" & Rng.Row).Value = .Range("D2:E2").Value
  22.         '------------------------------------------------
  23.     End With
  24.     If ActiveSheet.Name = Sht1.Name And xRow > 8 Then
  25.         ActiveWindow.ScrollRow = xRow - 6 'Åý³Ì·s¸ê®Æ«O«ù¦b¥i¨£µøµ¡¤¤
  26.     End If
  27.     Beep
  28.     '------------------------------------------------
  29.     ThisWorkbook.Save   '¦sÀÉ
  30.     Application.OnTime Now + TimeValue("00:00:01"), "¦Û°Ê°O¿ý"   '¨C¤@¬í»¼°j¤@¦¸
  31. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ daniel5168 ©ó 2015-8-4 09:49 ½s¿è

¦^´_ 5# GBKEE
¦­¤W¤w¸g®M¤J¸Õ¥Î,¦ý¥L¦n¹³¬O¨C¬í°O¿ý¤@¦¸,§Ú¥[¤JIf Second(Time) = 0 And Minute(Time) Mod 1 = 0 Then
¤§«á¥X²{¿ù»~°T®§¦p¹Ï

·Q¥¦¨C¬í¦a¦^¤@¦¸¤S·Q¨C¤@¤ÀÄÁ°O¿ý§Ú¸Ó«ç»ò§ï,¦³³Ò«üÂI¤F.§Ú¤]¤@Ãä¦Û¤v§V¤O§ï§ï¬Ý

TOP

¦^´_ 6# daniel5168


    §A¥[¤FIf Second(Time) = 0 And Minute(Time) Mod 1 = 0 Then«o¨S¦³µ¹¥¦End If

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2015-8-4 14:17 ½s¿è

¦^´_ 6# daniel5168


¦ý¥L¦n¹³¬O¨C¬í°O¿ý¤@¦¸,
³o¸Ì­×§ï Application.OnTime Now + TimeValue("00:01:00"), "¦Û°Ê°O¿ý"   '¨C¤@¤À»¼°j¤@¦¸
¥i¥H¤£¥Î If Second(Time) = 0 And Minute(Time) Mod 1 = 0 Then ³o¦æµ{¦¡½X

¿ù»~°T®§ ¨S¦³ With, lpk187 »¡¤F¤Ö¤FEnd If
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# lpk187
¦hÁÂlpk187  ¤j¤j,ÁöµM¤£À´¾ã­Óµ{¦¡«ç»ò¸ÑŪ,¦ý¬O§Ú¥´END IF¹Á¸Õ¦b¦U­Ó¦ì¸m,²×©ó¦¨¥\

TOP

¥»©«³Ì«á¥Ñ daniel5168 ©ó 2015-8-4 15:18 ½s¿è

¦^´_ 8# GBKEE

¦hÁÂGBKEE  ª©¥DÀ°¦£¸Ñµª,¸g¹L±zªº½s¼g,§Ú¶Ã§ï¥X°ÝÃD,lpk187¤j¤jªº«üÂI,§Ú¦A¶Ã§ï,²×©ó´ú¸Õ¦¨¥\
  1. Public uMode&, StartTime, EndTime
  2. Public MyBook As Workbook, Sht1 As Worksheet, Sht2 As Worksheet, xRow&

  3. Sub ¦@¥Î°Ñ·Ó()
  4. Set MyBook = ThisWorkbook
  5. Set Sht1 = MyBook.Sheets("¥x«üªñ¤@¤ÀÄÁ½u")
  6. StartTime = "08:44:50"  '¶}½L®É¶¡¡]´£¦­¤Q¬í¶}©l¡A¤~¥i°O¿ý¶}½L¶q»ù¡^"08:44:50"
  7. EndTime = "21:45:10"    '¦¬½L®É¶¡¡]©µ«á¤Q¬í°±¤î°O¿ý¡^¦¹¬°´ú¸Õ¥Î®É¶¡¡A½Ð¦Û¦æ§ó§ï¥¿¦¡®É¶¡ "13:45:10"
  8. End Sub

  9. Sub ¦Û°Ê°O¿ý()
  10.     Dim Rng As Range, º¦¶^ As Single, §¡»ù As Single
  11.     If uMode = 0 Then Exit Sub
  12.     With Sht1
  13.         If Time > TimeValue(EndTime) Then '¦¬½L®É¶¡¥H«á¤£°õ¦æ
  14.             .[F2] = "¤w¹L¦¬½L"
  15.             uMode = 0
  16.             Exit Sub
  17.         End If
  18.         Sht1.Range("B2") = Time '·í«e®É¶¡¡]®É¶¡½Xªí¡^
  19.         '----------------------------------------------------------
  20.         '¨C¢°¤ÀÄÁ°O¿ý¡A¢´¤ÀÄÁ«h§ï¬° Mod 5
  21.         If Second(Time) = 0 And Minute(Time) Mod 1 = 0 Then
  22.         Set Rng = .Range("A65536").End(xlUp).Offset(1)
  23.         .Range("A" & Rng.Row & ":C" & Rng.Row).Value = .Range("A2:C2").Value
  24.         With .Cells(Rng.Row, "C")   '
  25.             'º¦¶^ªº©w¸qÀ³¸Ó¬O(³o¤ÀÄÁ¦¨¥æ»ù-¤W¤ÀÄÁ¦¨¥æ»ù)/¤W¤ÀÄÁ¦¨¥æ»ù
  26.             If .Row >= 4 Then º¦¶^ = (.Cells - .Cells.Offset(-1))
  27.             '20³æ¦ì¶g´Á§¡»ù
  28.             If .Row >= 22 Then §¡»ù = Application.WorksheetFunction.Average(.Cells.Offset(-19).Resize(20))
  29.         End With
  30.         .Range("D2") = IIf(º¦¶^ <> 0, º¦¶^, "")
  31.         .Range("E2") = IIf(§¡»ù <> 0, §¡»ù, "")
  32.         .Range("D" & Rng.Row & ":E" & Rng.Row).Value = .Range("D2:E2").Value
  33.         End If
  34.         '------------------------------------------------
  35.     End With
  36.     If ActiveSheet.Name = Sht1.Name And xRow > 8 Then
  37.         ActiveWindow.ScrollRow = xRow - 6 'Åý³Ì·s¸ê®Æ«O«ù¦b¥i¨£µøµ¡¤¤
  38.     End If
  39.     Beep
  40.     '------------------------------------------------
  41.     ThisWorkbook.Save   '¦sÀÉ
  42.     Application.OnTime Now + TimeValue("00:00:01"), "¦Û°Ê°O¿ý"   '¨C¤@¬í»¼°j¤@¦¸
  43. End Sub
  44. Sub ¶}©l°õ¦æ()
  45. If uMode = 1 Then Exit Sub
  46. Call ¦@¥Î°Ñ·Ó
  47. uMode = 1
  48. Sht1.[F2] = "°õ¦æ¤¤"
  49. Call ¦Û°Ê°O¿ý
  50. End Sub

  51. Sub °±¤î°õ¦æ()
  52. uMode = 0
  53. Call ¦@¥Î°Ñ·Ó
  54. Sht1.[F2] = "STOP"
  55. End Sub

  56. Sub ²M°£°O¿ý¸ê®Æ()
  57. Beep
  58. If MsgBox("¡°½T©w­n²M°£¡eSheet1¡fªº°O¿ý¶Ü¡H¡@", 4 + 32 + 256) = vbNo Then Exit Sub
  59. Call ¦@¥Î°Ñ·Ó
  60. Sht1.Rows("3:65536").ClearContents
  61. If ActiveSheet.Name = Sht1.Name Then ActiveWindow.ScrollRow = 1
  62. Beep
  63. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ·O´d¨S¦³¼Ä¤H¡A´¼¼z¤£°_·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD