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

[µo°Ý] ½Ð±Ð§ì¨ú¤Ó¥­¬vÃÒ¨÷ªºDDE ­n¦p¦ó±q¤¤§ì¨ú¨C¤ÀÄÁªº³Ì¤j¦¨¥æ»ù¤Î³Ì¤p¦¨¥æ»ù

¦^´_ 8# c_c_lai
§Ú¬O¨Ï¥ÎEASYWINªºdde°T¸¹¡A¦pªG­n¨C30¬í°O¿ý¤@½ë¤W­±©Ò¦³ªº¸ê®Æ¸Ó¦p¦ó¼gVBA?¦]¬°®Mªí¤W¥h³£·|²£¥Í¿ù»~·d¤£²M·¡°ÝÃD¥X¦b­þ???

³Â·Ð±z¤FÁÂÁÂ!!

EASYWIN0909.rar (1.95 KB)

TOP

¦^´_  c_c_lai
§Ú¬O¨Ï¥ÎEASYWINªºdde°T¸¹¡A¦pªG­n¨C30¬í°O¿ý¤@½ë¤W­±©Ò¦³ªº¸ê®Æ¸Ó¦p¦ó¼gVBA?¦]¬°®Mªí¤W¥h ...
ribbits µoªí©ó 2012-9-9 14:31

¶K¤Wµ{¦¡½X¡A¨Ñ§A°Ñ¦Ò¡G
  1. Option Explicit
  2. Dim timerEnabled As Boolean    ' §P©w¶}±Ò¥»¤u§@ªí³æªº®É¬q¬O§_¬°¶}½L«e±Ò°Ê¡C

  3. Private Sub Workbook_Open()
  4.     Dim Pos As Long             ' ±N¨C¹j "¦h¤Ö®É¶¡" ³B²z®É¬q¡A²¾¨ì¦¹³B¨Ó³B²z¡C
  5.     timerEnabled = False

  6.     Pos = Sheets("Data").Range("A" & Rows.Count).End(xlUp).Row   ' ¨D¥X¸ÓÄ椧³Ì«á¨Ï¥Î¦C¼Æ
  7.     If (Pos <= 1) Then Pos = 1
  8.     Sheets("µ¦²¤°O¿ý").[A4] = "¤w¶×¤J " & (Pos - 1) & " µ§¸ê®Æ"
  9.     Call timerStart      ' µ{¦¡¤@±Ò©l¡A«K¥h¦Û°Ê°õ¦æ timerStart
  10. End Sub

  11. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  12.     On Error Resume Next
  13.     Application.OnTime Now + TimeValue("00:00:01"), "ThisWorkbook.ATimer", , False
  14.    
  15.     Me.Save
  16. End Sub

  17. Public Sub ATimer()
  18.     Dim Pos As Long             ' ±N¨C¹j "¦h¤Ö®É¶¡" ³B²z®É¬q¡A²¾¨ì¦¹³B¨Ó³B²z¡C
  19.    
  20.     On Error Resume Next
  21.     ' If (TimeValue(Now) > TimeValue("13:45:00")) Then Exit Sub
  22.    
  23.     If (TimeValue(Now) >= TimeValue("08:45:00")) Then         ' ¶}½L¡B¦¬½L®É¬q³]©w
  24.         ' ½L¤¤³B²z¡A±N¸ê®Æ¶×¤J¼g¤J¤u§@ªí³æ¤ºÀx¦s¡C
  25.         With Sheets("Data")
  26.             Pos = .Range("B" & Rows.Count).End(xlUp).Row   ' ¨D¥X¸ÓÄ椧³Ì«á¨Ï¥Î¦C¼Æ
  27.             If (Pos <= 1) Then Pos = 1
  28.             Pos = Pos + 1                   ' ±NÅܰʦ渹¥[¤@¦æ
  29.             Sheets("µ¦²¤°O¿ý").[A4] = "¤w¶×¤J " & (Pos - 1) & " µ§¸ê®Æ"

  30.             If Not IsError(Sheets("µ¦²¤°O¿ý").[E2]) Then
  31.                  .Cells(Pos, 1) = Date                              ' ¤é´Á
  32.                  .Cells(Pos, 2) = Time                              ' ®É¶¡
  33.                  .Cells(Pos, 3) = Sheets("µ¦²¤°O¿ý").[E2]           ' ¦¨¥æ»ù
  34.                  .Cells(Pos, 4).Offset(0).Resize(, 3) = Sheets("µ¦²¤°O¿ý").[G2:I2].Value
  35.                  .Cells(Pos, 7) = Sheets("µ¦²¤°O¿ý").[K2]           ' ¦¨¥æ¶q
  36.                 .Cells(Pos, 8).Offset(0).Resize(, 8) = Sheets("µ¦²¤°O¿ý").[O2:V2].Value
  37.             End If
  38.         End With
  39.     End If
  40.     If timerEnabled Then Call timerStart
  41. End Sub

  42. Sub timerStart()
  43.     If timerEnabled Then
  44.         ' ²Ä¤G¦¸(§t)¥H«á§¡¥H³]©w¤§ "¶¡¹j®É¬q" ¨Ó³B²z°õ¦æ§Çªº§@·~¡C
  45.         Application.OnTime (Now + TimeValue("00:00:30")), "ThisWorkbook.ATimer"
  46.     Else
  47.         timerEnabled = True
  48.         
  49.         ' ±N²Ä¤@¦¸±Ò°Ê®É¶¡§ó§ï¬°³]©w "¶}½L®É¶¡"«e¡A¦pªG¶}±Ò Excel ®É¡A¤w¸g¹L¤F³]©w "¶}½L®É¶¡"¡A«h¤@¶i¤J¨t²Î§Yª½±µ¥h°õ¦æ¬ö¿ý§@·~¡C
  50.         If (TimeValue(Now) <= TimeValue("08:45:00")) Then
  51.             Application.OnTime (TimeValue("08:45:00")), "ThisWorkbook.ATimer"
  52.         Else
  53.             ' ¨t²Î­è³s¤W DDE ¦Ü¸ê®Æ¶×¤JExcel¤u§@ªí³æ¡A¶·¦³¤@­Ó½w½Ä®É¬q¡A
  54.             ' ³o®É¦pªG°¨¤W¥h§ì¨úDDE¸ê®Æ¡A·|¦³«¬ºA¤£²Åªº¿ù»~°T®§²£¥Í¡A¨Ã¤¤Â_°õ¦æ§Çªº§@·~¡C
  55.             Application.OnTime (Now + TimeValue("00:00:05")), "ThisWorkbook.ATimer"
  56.         End If
  57.     End If
  58. End Sub
½Æ»s¥N½X
¦]¬°§A¥Ø«eµLÅv¤U¸ü¡A©Ò¥H±N°õ¦æµe­±¶K¥Ü¡A§A¥u­n·ÓµÛ­×¥¿§Y¥i¡G

EASYWIN0909.rar (12.11 KB)

TOP

¦^´_ 21# ribbits
¹ï¤£°_¡A­è¤~¬°¤F´ú¸Õ¦Ó§ÑÁA±N¥¦§ó§ï¦^¨Ó¡A½Ð±N¤U¦C¤§ Remark ­×¥¿¦^¨Ó¡G
  1. Public Sub ATimer()
  2.     Dim Pos As Long             ' ±N¨C¹j "¦h¤Ö®É¶¡" ³B²z®É¬q¡A²¾¨ì¦¹³B¨Ó³B²z¡C
  3.    
  4.     On Error Resume Next
  5.     ' If (TimeValue(Now) > TimeValue("13:45:00")) Then Exit Sub
½Æ»s¥N½X
¥¿½T¬° (³Ì«á¤@¦æ)¡G
  1. Public Sub ATimer()
  2.     Dim Pos As Long             ' ±N¨C¹j "¦h¤Ö®É¶¡" ³B²z®É¬q¡A²¾¨ì¦¹³B¨Ó³B²z¡C
  3.    
  4.     On Error Resume Next
  5.     If (TimeValue(Now) > TimeValue("13:45:00")) Then Exit Sub
½Æ»s¥N½X
ÁÂÁ¡I

TOP

½Ð±Ðc_clai¤j,¦³¿ìªk½L¤¤§Y®Éµe¥X¤@­ÓÁ`©e¶R¤f´î¥hÁ`©e½æ¤fªº¹Ï¶Ü?
ÁÂÁ¦^µª

TOP

½Ð±Ðc_clai¤j,¦³¿ìªk½L¤¤§Y®Éµe¥X¤@­ÓÁ`©e¶R¤f´î¥hÁ`©e½æ¤fªº¹Ï¶Ü?
ÁÂÁ¦^µª
steveyeh168 µoªí©ó 2012-9-10 00:29

§A¥u­n¦h¼W¥[¤@­ÓÄæ¦ì¦WºÙ°²³]©w¬° "´²¤á¤è¦V"¡A
µM«á¥H¦¹Äæ§@¬° "¿ï¨ú¸ê®Æ" ¶µ´N¥i¥Hµe¥X¹Ïªí¤F¡C

TOP

¦^´_ 23# c_c_lai


   §Ú¹ïVBA¯uªº¤£À´¡A­è­è§âµ{¦¡½X·Ó³æ¶K¤WÁÙ¬O¿ù»~¤@°ï¡A½Ð°Ý¬O¶K¦bWORKBOOK¤W¶Ü?

ÁÙ¦³§A³o©Ò¿×ªº¿ù»~±q¤W­±¬Ý¨â­Óµ{¦¡½X¬O§¹¥þ¤@¼Ëªº°Ú!!

¯uªº¤£À´:(

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2012-9-10 12:13 ½s¿è

¦^´_ 26# ribbits
¶K¦b ThisWorkbook ¤º¡C
ªº¤Í¥[¤W '
¥¿½T¦a¤w§R±¼ '

TOP

c_c_lai¤j,§Ú¬O¤p¾Ç¥Í,±Mµ{½Ð±Ð......
1.¥´¶}easywin,
2.DDEÄæ¦ì­n¥ý¸ò«e¹Ï¤@¹³Äæ¦ì?
3.µM«á§âsource code¶K¨ìThisWorkbook,¥t¦s¦A¥´¶}?
4.¹j¤é¶}½Lµ¥µe¹Ï(ÁÙ¥¼¥[¤J©e¶R½æ¤f¬Û´î)¶Ü?
ÁÂÁÂÀ°¦£

TOP

¦^´_ 27# c_c_lai

½sĶ®É³£·|¸õ¨ì³oPrivate Sub Workbook_Open()
µM«áµLªk°õ¦æ¡A³o°ÝÃD¥X²{¦b­þÃä?

ÁÙ¦³¡A­ì©lªºDDE°T¸¹Äæ¬O¦bµ¦²¤°O¿ýÁÙ¬OData¤W?

¥t¥~Ãö©ó±z³o¨Ç»Pªk»P§ì¨ú¼Ò¦¡¯à¸Ô²Ó»¡©ú¤@¤U¶Ü?Åýªì¾ÇªÌ§â°ò¦§Ë²M·¡¦Ó¤£¬O·Ó§Û¦Ó¤£ª¾©Ò¤ª¡AÁÂÁÂ!

©ÎªÌ¡A±z¯à«ü¤Þ¤@¤U­þÃ䦳¯à°w¹ïVBA°µ¸Ô²Ó»¡©úªº???

TOP

¦^´_  c_c_lai

½sĶ®É³£·|¸õ¨ì³oPrivate Sub Workbook_Open()
µM«áµLªk°õ¦æ¡A³o°ÝÃD¥X²{¦b­þÃä?

ÁÙ ...
ribbits µoªí©ó 2012-9-10 23:09

³o¥÷¹ÏªíÀ³¸Ó¤w¦^µª§Aªº°ÝÃD¤F¡A¦p¤´¤£¸Ñ§A¥u¦n¬è¨D¤W»a¤F¡I

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD