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

[µo°Ý] 劵°ÓDDE¶ÇExcel ¨C¤À¦Û°Ê°O¿ý¼Æ¾Ú

¦^´_ 20# andylin
ÁÂÁ§Aªº¹ÏÀÉ ¹j¦æ¦p¹j¤s,§Ú§¹¥þ¬Ý¤£À´.«¢....

­Y©ú¤é8:45am¶}½L«e §Ú¶}°_¦¹excelÀÉ«á §Ú¬O§_»Ý­n¦Û¤v¤â°Ê±NexcelÄæ¦ì¸Ì¤µ¤éªº¼Æ¾Ú¥þdelete±¼?
µª®×¦b³o¸Ì
Private Sub Workbook_Open()    '¦¹µ{¦¡¬OÀɮ׶}±Ò®É¦Û°Ê°õ¦æªºµ{¦¡
    Dim E As Range
    If MsgBox("±Ò°Ê¦Û°Ê°O¿ý¸ê®Æ??", vbYesNo) = vbNo Then Exit Sub      '«ö Yes ·|¨Ì§Ç²M°£¬Q¤é¸ê®Æ «ö No Â÷¶}µ{¦¡   
    Sheets("1¤ÀK").UsedRange.Offset(1, 1) = ""       ' ²M°£¬Q¤é¸ê®Ædelete±¼
    Sheets("5¤ÀK").UsedRange.Offset(1, 1) = ""       '  ²M°£¬Q¤é¸ê®Æ delete±¼   
    Sheets("15¤ÀK").UsedRange.Offset(1, 1) = ""     '  ²M°£¬Q¤é¸ê®Ædelete±¼





TOP

¥»©«³Ì«á¥Ñ andylin ©ó 2011-7-24 17:51 ½s¿è

¦^´_ 21# GBKEE

¤j¤j¯uªºÁÂÁ±z Orz
¯uªº«D±`·PÁ±z
Åý¤p§Ì¥\¤O´£ª@¦Ü¥t¤@¼h¯Å
¯uªº·P®¦
¦A¤T·PÁ±z Orz

TOP

¥»©«³Ì«á¥Ñ andylin ©ó 2011-7-24 17:53 ½s¿è

¦^´_ 21# GBKEE


¤j¤j±z¦n
¹ï¤£°_ ¤S¨Ó³Â·Ð±z Orz

§Ú±N«e¤@­Ó¤j¤j©Ò¶Ç±ÂªºExcel VBA¤º®e
§V¤O²z¸Ñ«á ¸ÕµÛ¨Ì¤j¤jªºµ{¦¡½X»yªk ¹Á¸Õ½s¼g°ê¥~°Ó«~
¦ý§Ú¼g¥X¨Óªº¨S¦^À³  ¤@.¤@"'
¤£ª¾§Úµ{¦¡½X¨º¸Ì¦³»~
ÁٽФj¤j´£Äâ«ü¾É Orz

¤£ª¾­n«ç¼Ë¼g
§Æ±æVBA¯à¦Û°Ê­pºâ±a¥Xªº¼gªk
ÁÙ¦³³Ò¤j¤j±z¼·É¯«ü¾É Orz

µ¹±z²K³Â·Ð¤F Orz
¯uªº·PÁ±z
·P®¦ Orz

for GBKEE¤j_¤¸¤jExcel VBA_°ê¥~´Á_20110714_test 01.rar (18.28 KB)

TOP

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

¦^´_ 23# andylin
¨Ì¼Ëµe¸¬Äª ¸Õ¸Õ¬Ý
  1. 'ThisWorkbook¼Ò²Õªºµ{§Ç
  2. Private Sub Workbook_Open()    '¦¹µ{¦¡¬OÀɮ׶}±Ò®É¦Û°Ê°õ¦æªºµ{¦¡
  3.     Dim E As Range
  4.     If MsgBox("±Ò°Ê¦Û°Ê°O¿ý¸ê®Æ??", vbYesNo) = vbNo Then Exit Sub
  5.     Sheets("1¤ÀK").UsedRange.Offset(1, 1) = ""       '  ²M°£¬Q¤é¸ê®Æ
  6.     Sheets("5¤ÀK").UsedRange.Offset(1, 1) = ""
  7.     Sheets("15¤ÀK").UsedRange.Offset(1, 1) = ""
  8.     Application.OnTime #9:00:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
  9.     '**** 09:00:00®É¶¡°õ¦æµ{¦¡ ->¸ê®Æ¿é¤J
  10. End Sub
  11. Sub ¸ê®Æ¿é¤J()
  12.     Dim Ar(1 To 15)      'Ar°}¦C ->  ¦s¤J§A­nªº¼Æ¾Ú
  13.     Ar(1) = Time
  14.     Ar(2) = [Table!B2]
  15.     Ar(3) = [Table!C2]
  16.     Ar(4) = "=IF(ROW()>2,RC[-2]-R[-1]C[-2],"""")"    ' **  ¤½¦¡
  17.     Ar(5) = "=IF(ROW()>2,RC[-2]-R[-1]C[-2],"""")"
  18.     'Ar(6) ªÅ¥Õ
  19.     Ar(7) = [Table!E2]
  20.     Ar(8) = [Table!F2]
  21.     Ar(9) = "=IF(ROW()>2,RC[-2]-R[-1]C[-2],"""")"
  22.     Ar(10) = "=IF(ROW()>2,RC[-2]-R[-1]C[-2],"""")"
  23.     'Ar(11) ªÅ¥Õ
  24.     Ar(12) = [Table!H2]
  25.     Ar(13) = [Table!I2]
  26.     Ar(14) = "=IF(ROW()>2,RC[-2]-R[-1]C[-2],"""")"
  27.     Ar(15) = "=IF(ROW()>2,RC[-2]-R[-1]C[-2],"""")"
  28.     If Minute(Time) Mod 1 = 0 Then Sheets("1¤ÀK").Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(1, UBound(Ar)).Value = Ar  'Minute(Time) Mod 1=0  ¨C¤ÀÄÁ
  29.     If Minute(Time) Mod 5 = 0 Then Sheets("5¤ÀK").Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(1, UBound(Ar)).Value = Ar  'Minute(Time) Mod 1=0  ¨C5¤ÀÄÁ
  30.     If Minute(Time) Mod 15 = 0 Then Sheets("15¤ÀK").Range("A" & Rows.Count).End(xlUp).Offset(1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 1 =0 ¨C15¤ÀÄÁ
  31.     If Time <= #1:30:00 PM# Then Application.OnTime TimeValue(Format(Time, "hh:MM:00")) + #12:01:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
  32.     ' ***  #1:30:00 PM# ¤§«e®É¶¡°õ¦æµ{¦¡ ->¸ê®Æ¿é¤J
  33. End Sub
½Æ»s¥N½X
½Ð¬Ý³o¸ÌªºPS

TOP

¥»©«³Ì«á¥Ñ andylin ©ó 2011-7-24 17:54 ½s¿è

¤j¤jÁÂÁ±z Orz
¯uªº·PÁ±z
·P®¦ Orz

TOP

¦^´_ 24# GBKEE

¤j¤j ¤£¦n·N«ä
¤p§Ì¤¤¤å¤£¦n ­^¤å¤£¦æ
»~¸Ñ¤F ÁٽШ£½Ì
§ÚÁA¸Ñpsªº·N«ä¤F
¤µ«áÁٽЦU¦ì¥ý¶i½å«ô¤£§[«ü¾É

·P®¦·P®¦ Orz Orz

TOP

¥»©«³Ì«á¥Ñ andylin ©ó 2011-7-24 17:55 ½s¿è

¦^´_ 24# GBKEE

¤j¤j±z¦n
¹ï¤£°_
¤£¤~¤p§Ì¤S¨Ó³Â·Ð±z

³o¦¸·Q§âªþÀÉ"table"¸Ìªº¤T­ÓÄæ¦ì: B2  C2  D2ªº¼Æ­È
§Æ±æ¯à¨Ì1¤À/5¤À/15¤À ¤À§O©w®É©w¦s¤J 1¤À/5¤À/15¤À sheets¸Ìlist¥X¼Æ¾Ú¨Ó
¤£¾å±o±z¬O§_¯à¦A¦¸«ü¾É¤p§Ì¤@µf Orz  Orz

¦³³Ò±z¼·É¯«ü¾É
¤p§Ì·P¿E¤£ºÉ Orz
­Y¦³«ÝºC±z¤§³BÁٽбz¨£½Ì
«ô°U±z Orz  Orz

20110721_for GBKEE¤j¤j.rar (15.17 KB)

TOP

¦^´_ 27# andylin
  1. 'ThisWorkbook¼Ò²Õªºµ{§Ç
  2. Private Sub Workbook_Open()    '¦¹µ{¦¡¬OÀɮ׶}±Ò®É¦Û°Ê°õ¦æªºµ{¦¡
  3.     Dim E As Range
  4.     If MsgBox("±Ò°Ê¦Û°Ê°O¿ý¸ê®Æ??", vbYesNo) = vbNo Then Exit Sub
  5.     Sheets("1¤ÀK").UsedRange.Offset(1, 1) = ""       '  ²M°£¬Q¤é¸ê®Æ
  6.     Sheets("5¤ÀK").UsedRange.Offset(1, 1) = ""
  7.     Sheets("15¤ÀK").UsedRange.Offset(1, 1) = ""
  8.     Application.OnTime #8:46:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
  9.     '**** 08:46:00®É¶¡°õ¦æµ{¦¡ ->¸ê®Æ¿é¤J
  10. End Sub
  11. Sub ¸ê®Æ¿é¤J()
  12.     '''''''''''''''''''''''''''''''''''''
  13.     'Dim Ar()      'Ar°}¦C ->  ¦s¤J§A­nªº¼Æ¾Ú
  14.     'Ar = Sheets("Table").Range("B2:D2").Value
  15.     '''''''''''''''''''''''''''''''''''''
  16.     Dim Ar(1 To 3)      'Ar°}¦C ->  ¦s¤J§A­nªº¼Æ¾Ú
  17.     Ar(1) = [Table!B2]
  18.     Ar(2) = [Table!C2]
  19.     Ar(3) = [Table!D2]
  20. '**   Sheets("1¤ÀK").Range("B" & Rows.Count).End(xlUp).Offset(1) **   ¸ê®Æ±qBÄæ¶}¨Ï¸m¤J **

  21. If Minute(Time) Mod 1 = 0 Then Sheets("1¤ÀK").Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(1, UBound(Ar)).Value = Ar  'Minute(Time) Mod 1=0  ¨C¤ÀÄÁ
  22.     If Minute(Time) Mod 5 = 0 Then Sheets("5¤ÀK").Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(1, UBound(Ar)).Value = Ar  'Minute(Time) Mod 1=0  ¨C5¤ÀÄÁ
  23.     If Minute(Time) Mod 15 = 0 Then Sheets("15¤ÀK").Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 1 =0 ¨C15¤ÀÄÁ
  24.     If Time <= #1:30:00 PM# Then Application.OnTime TimeValue(Format(Time, "hh:MM:00")) + #12:01:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
  25.     ' ***  #1:30:00 PM# ¤§«e®É¶¡°õ¦æµ{¦¡ ->¸ê®Æ¿é¤J
  26. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ andylin ©ó 2011-7-24 17:56 ½s¿è

¦^´_ 28# GBKEE

¤j¤j±z¦n
·PÁ±z
·P®¦ Orz

for GBKEE¤j¤j_20110721_test02.rar (22.96 KB)

TOP

¦^´_ 29# andylin
¦¬¥««e¦³®Ä ¸Õ¸Õ¬Ý
  1. 'ThisWorkbook¼Ò²Õªºµ{§Ç
  2. Private Sub Workbook_Open()    '¦¹µ{¦¡¬OÀɮ׶}±Ò®É¦Û°Ê°õ¦æªºµ{¦¡
  3.     If MsgBox("±Ò°Ê¦Û°Ê°O¿ý¸ê®Æ??", vbYesNo) = vbNo Then Exit Sub
  4.     Sheets("1¤ÀK").UsedRange.Offset(1, 1) = ""       '  ²M°£¬Q¤é¸ê®Æ
  5.     Sheets("5¤ÀK").UsedRange.Offset(1, 1) = ""
  6.     Sheets("15¤ÀK").UsedRange.Offset(1, 1) = ""
  7.     If Time >= #8:46:00 AM# And Time <= #1:30:00 PM# Then   '¶}¥«®É¶¡¤º¶}ÀÉ
  8.         ¸ê®Æ¿é¤J
  9.    ElseIf Time < #8:46:00 AM# Then                          '¶}¥««e¤º¶}ÀÉ
  10.         Application.OnTime #8:46:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
  11.    End If
  12. End Sub
  13. Sub ¸ê®Æ¿é¤J()
  14.     Dim E As Range
  15.     '''''''''''''''''''''''''''''''''''''
  16.     'Dim Ar()      'Ar°}¦C ->  ¦s¤J§A­nªº¼Æ¾Ú
  17.     'Ar = Sheets("Table").Range("B2:D2").Value
  18.     '''''''''''''''''''''''''''''''''''''
  19.     Dim Ar(1 To 3)      'Ar°}¦C ->  ¦s¤J§A­nªº¼Æ¾Ú
  20.     Ar(1) = [Table!B2]
  21.     Ar(2) = [Table!C2]
  22.     Ar(3) = [Table!D2]
  23.     If Minute(Time) Mod 1 = 0 Then
  24.         Set E = Sheets("1¤ÀK").Range("A:A").Find(TimeSerial(Hour(Time), Minute(Time), 0))
  25.         E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 1=0  ¨C¤ÀÄÁ
  26.     End If
  27.     If Minute(Time) Mod 5 = 0 Then
  28.         Set E = Sheets("5¤ÀK").Range("A:A").Find(TimeSerial(Hour(Time), Minute(Time), 0))
  29.         E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 5=0  ¨C5¤ÀÄÁ
  30.     End If
  31.     If Minute(Time) Mod 15 = 0 Then
  32.         Set E = Sheets("15¤ÀK").Range("A:A").Find(TimeSerial(Hour(Time), Minute(Time), 0))
  33.         E.Offset(0, 1).Resize(1, UBound(Ar)).Value = Ar 'Minute(Time) Mod 15=0  ¨C15¤ÀÄÁ
  34.     End If
  35.     If Time <= #1:30:00 PM# Then Application.OnTime TimeValue(Format(Time, "hh:MM:00")) + #12:01:00 AM#, "ThisWorkbook.¸ê®Æ¿é¤J"
  36.     ' ***  #1:30:00 PM# ¤§«e®É¶¡°õ¦æµ{¦¡ ->¸ê®Æ¿é¤J
  37.     Set E = Nothing    '
  38. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ­ì½Ì§O¤H´N¬Oµ½«Ý¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD