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

[¤À¨É] ½L¤¤ DDE ¦sÀÉ»P VBA ªº¹ê»ÚÀ³¥Î½d¨Ò

¦^´_ 24# ribbits
ºÝµø§Aµ{¦¡¼¶¼gªº§Þ¥©¡A¬O¥i¥H°µ¨ìªº¡I

TOP

¦]¬°­Ó§OºÞ²zÃö«Y¡A«Ü¦h¸ê®Æ³£¥²¶·¿W¥ß¤À¹j¨Ó¶°¤¤³sÄò°O¿ýªº¡A©Ò¥H¦P®É°õ¦æ¦n´X­Ó¿W¥ßEXCELªºª¬ªp¥i¯àµLªkÁקK¡C
°£«D§â³sÄò°T¸¹¾É¤JÃþ¦üACCRESS©ÎSQLµ¥©¹«áºÝ¸ê®Æ®w¶°¤¤ºÞ²z¡A¤£¹L³o¨Ç§Ú¤§«e°Ý¹L¦n¹³¨S¤H¦^µª§Ú:¸Ó¦p¦ó§@

¦]¬°§ÚªºVBA·§©À¹ê¦b¤ÓÄê¤F¡A©Ò¥HªÅ¦³¬[ºc«oµLªk°õ¦æ:'

TOP

¦^´_ 23# c_c_lai


        ©Ò¥H¦b°õ¦æ®É¬q¤W­Y¨C15¤À°O¿ý¸ê®Æ¤§EXCL VBAµ{¦¡¶·¶°¤¤¦b³æ¤@EXCEL¤º¡A¦Ó¤£¦P®É¬qªºVBAµ{¦¡«h¤£¨ü¼vÅT¤F¶Ü?
¤ñ¦p°ê¥~´Á³fªº®É¬q´N»P°ê¤º¤£¦P¡A¦]¦¹°O¿ýªºEXCEL VBA¥i­Ó§O¶}±Ò¶Ü?
¦]¬°®É¶¡®t¤£¦P¡A¥u­n¨ú¥Î·í¦a®É¶¡¨Ó¿ù¶}´N¤£·|¥X¿ù¤F§a?

TOP

¦^´_  c_c_lai


    ¨º½Ð¸û¤@¤U¡A­Y¦P®É¨ú¥Î¤£¦P°T¸¹¨Ó·½®É¡A­n¦p¦ó³WÁ×±z©Ò»¡ªº¿ù»~­·ÀI©O?
ribbits µoªí©ó 2012-9-9 11:07

«D "¤£¦P°T¸¹¨Ó·½"¡A§Ú«üªº¬OºÉ¥i¯à¤£­n¦b¦P¤@®É¬q¥h
¦P®É°õ¦æ¤@¤ä¥H¤W±a¦³VBAµ{¦¡°õ¦æ½Xªº Excel ÀɮסC
ªþ¤W¹Ï¤ù§Æ±æ¯àÀ°§U§A¤F¸Ñ¡G

§A¥i¥H¦b¤@ªí³æ¤º¦P®É¶×¤J¤@¤ä¥H¤W¤£¦P DDE °T¸¹¨Ó·½¡A³oµ´¹ï¬O OK ªº¡A
¦ý¬O¦pªG§A¦b¦P¤@®É¬q¦P®É°õ¦æ¤@¤ä¥H¤WÃþ¦ü¦p¦¹¤§VBA
°õ¦æµ{¦¡¡AVBA µ{¦¡·¥¦³¥i¯à·|ÀH®É²ö¦W¨ä§®¦a³Q¤¤Â_ (Interrupt)¡C
(§Ú­Ó¤HÅéÅç¡A¹ð¸Õ¤£²n)    ¦]¦¹¤~·|¦p¦¹«Øijªº¡C

TOP

¦^´_ 17# c_c_lai


    ¨º½Ð¸û¤@¤U¡A­Y¦P®É¨ú¥Î¤£¦P°T¸¹¨Ó·½®É¡A­n¦p¦ó³WÁ×±z©Ò»¡ªº¿ù»~­·ÀI©O?

TOP

¦^´_ 16# ajagow
½Ð±z¯d·N¬Ý¬Ý¡A¦b±zµ{¦¡°õ¦æªº¶¥¬q¬O§_¦P®É·|¥h°õ¦æ§O¤ä Excel µ{¦¡¡H
¦pªG¦³ªº¸Ü¡A½Ð¤Å¾Þ§@§O¤ä Excel¡A¦]¬°¥¦­Ìªº°õ¦æ§Ç¥i¯à³Q¤zÂZ¨ì¤F¡C

TOP

¦^´_ 13# c_c_lai


    C  C  LAI   ¤j¤j
§Ú²{¦b¦³¤@­Ó°ÝÃD?´N¬OEXCEL ¦b¶]ªº¦³®É­Ô·|¦Û°Ê°±¡A®É¶¡ÁÙ¬OÄ~Äò¬y³u¡C¦³¨Ç¸ê®Æ¨S¦³°O¿ý¨ì
¨º¦pªG§â·Q§â®É¶¡¤Á¦¨¤­­Ó¤p®É¨Ó­Ó§O°O¿ý¤£ª¾¹D¦³¨S¦³¿ìªk
08:45:00~09:44:59
09:45:00~10:44:59
10:45:00~11:44:59
11:45:00~12:44:59
12:45:00~13:44:59
¨Ó§ì¨ú¤p®Éªº¦¨¥æ»ù
³o­Ó«ÜÃø¡A§Ú¥h¤À¨â¬q¡A¥u¬Ý¨ìEXCELªº·Æ¹«¤@ª½µe¶ê°é.¹q¸£´N·íµÛ¡C
¯qÁ¨à

TOP

¥»©«³Ì«á¥Ñ et2002 ©ó 2012-4-16 00:35 ½s¿è

¤£¦n·N«ä.¤p§Ì¤£¤Ó©ú¥Õ EXCEL
¦pªG§Úªº DDE ¦ì¸m¬O 'MT4'|ASK!XAUUSD
¨º»ò À³¸Ó¥[¤J¨ì¨º?
°ÝÃD¤w¸Ñ¨M

TOP

¥»©«³Ì«á¥Ñ ajagow ©ó 2012-4-15 17:24 ½s¿è

¦^´_ 14# c_c_lai
·PÁ  ª©¥Dªº»¡©ú¤Îc c lai ­×§ïªºµ{¦¡
¯uªº·|¦Û¤v¶]
¤Ó¯«¤F
½¤«ô¤¤
¯qÁ¨à

TOP

¦^´_ 11# ajagow
Äæ¦ìªº½T»{«D±`­«­n¡A§Aªº»yªk§Úµy¥[­×§ï¤F¤@¤U¡A¤jÅé¤W¤]³£¤£¿ù¡A¥u¬O®É¶¡Äæ¦ìªº»{©w¼Ò½k¦Ó¤w¡A
§Ú±N­×§ï¤§³B¥Î  ' ******** ¥[¥H¼Ð¥Ü¥X¨Ó¡A¤è«K§AÁA¸ÑµLªk°õ¦æªº­ì¦]¡A¤U¦^§A´N·|¹ê»ÚÀ³¥Î¤F¡C
ªþ¤W¤w°õ¦æªº½d¨Ò¡A¥H¤Î§Aªº­×§ï«á¤§µ{¦¡½X (¦]§A©|µLªk¤U¸ü¡A©Ò¥H±N¥¦¶K¥Ü¥X¨Ó)¡A§A±Nµ{¦¡½X½Æ»s¨ì ThisWorkbook ¤º¡A¦Ó±N¼Ò²Õ²¾°£±¼¡C
  1. ' ½L¤¤ DDE ¦sÀɪº¹ê»ÚÀ³¥Î½d¨Ò
  2. Option Explicit
  3. Dim actEnabled As Boolean
  4. Dim CIndex As Single

  5. Private Sub Workbook_Open()
  6.     If (Sheets("¤u§@ªí1").Range("A1").Value = "") Then Sheets("¤u§@ªí1").Range("A1").Value = "01:11:00"   ' °²³]A1Äæ¦ì¬°ªÅ¥Õ¡A«h¼g¤J¶}½L°_©l®É¶¡
  7.     If (Sheets("¤u§@ªí1").Range("A2").Value = "") Then Sheets("¤u§@ªí1").Range("A2").Value = "13:45:59"   ' A2Äæ¦ì¥ç¦P¡C(¦¹¨âÄæ¬ö¿ý°_©l²×¤î®É¶¡)
  8.     If (Sheets("¤u§@ªí1").Range("A3").Value = "") Then Sheets("¤u§@ªí1").Range("A3").Value = 0            ' ¬ö¿ý³Ì«á¸ê®Æ¶×¤J¤§¦C¸¹ (Rows)¡C
  9.     If (Sheets("¤u§@ªí1").Range("A4").Value = "") Then Sheets("¤u§@ªí1").Range("A4").Value = "00:00:10"   ' ¬ö¿ý¸ê®Æ¶×¤J¬Û¹j®É¶¡¡A¦p¨C¹j¤Q¬í¼g¤J¤@¦¸¡C

  10.     ' If (TimeValue(Now) > Sheets("¤u§@ªí1").Range("A2").Value) Then     ' ********  §A¥´ºâ¦ó®É¶}©l¹B§@¡H13:45:59 ¥H«á¡H
  11.     If (TimeValue(Now) > Sheets("¤u§@ªí1").Range("A1").Value) Then       ' ¦pªG¥Ø«e®É¶¡·~¤w¶W¹LA2ªº®É¬q¡A«h©I¥s.......
  12.         ' Call stopProcedure         ' ***** ®É¶¡¨ì¤F¡AÃø¹D§A¤£­n°õ¦æ¡H
  13.         Call startProcedure
  14.     Else                                                                  ' ¤Ï¤§¡A«h©I¥s.......
  15.         Call stopProcedure
  16.         ' Call startProcedure        ' ***** ½Ð°Ý§A¬O­n¥¦¦b 14:00 ~ 01:09 ¶¡°õ¦æ¡H
  17.     End If
  18. End Sub

  19. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  20.     On Error Resume Next
  21.     Call actStop
  22. End Sub

  23. Sub startProcedure()       ' «O¯d§@¬°±±¨î¶µ¤§À³¥Îµ{§Ç¡A¦p«ö¶s¤§¥¨¶°À³¥Îµ¥¡C
  24.     Call actStart
  25. End Sub

  26. Sub stopProcedure()        ' «O¯d§@¬°±±¨î¶µ¤§À³¥Îµ{§Ç¡A¦p«ö¶s¤§¥¨¶°À³¥Îµ¥¡C
  27.    Call actStop
  28. End Sub

  29. Sub newTitle()
  30.    ' ®M¤W§A±ý¶×¤J¸ê®ÆªºªíÀY¦WºÙ
  31. End Sub

  32. Sub Starter()
  33.     If (actEnabled = True And TimeValue(Now) >= Sheets("¤u§@ªí1").Range("A1").Value And TimeValue(Now) <= Sheets("¤u§@ªí1").Range("A2").Value) Then
  34.         CIndex = Sheets("¤u§@ªí1").Range("A3").Value

  35.         If (CIndex = 0) Then Call newTitle  '°²³]newTitleµ{§Ç(¥Ñ¨Ï¥ÎªÌ¦Û¦æ©w¸q)¬O±N²Ä¤@¦Cªº¸ê®Æ©ïÀY¦WºÙ¼g¤J¨ì¤u§@ªí2¡C ¦p¡G¤é´Á¡B®É¶¡¡BR1C5ªº¹ïÀ³Äæ¦ì¸ê®Æµ¥¡C

  36.         Sheets("¤u§@ªí1").Range("A3").Value = CIndex + 1       ' ¬ö¿ý¦C¸¹¥[¤@¡C
  37.         Sheets("¤u§@ªí2").Cells(CIndex + 2, 1).Value = Date
  38.         Sheets("¤u§@ªí2").Cells(CIndex + 2, 2).Value = TimeValue(Now)
  39.         ' Sheets("¤u§@ªí2").Cells(CIndex + 2, 3).Value = Sheets("¤u§@ªí1").Cells(1, 5).Value
  40.         Sheets("¤u§@ªí2").Cells(CIndex + 2, 3).Value = Sheets("¤u§@ªí1").Cells(6, 1).Value         ' ´ú¸Õ¡A ¦]¤µ¤Ñ¤£½æ³½¡A §Aªº«ü©wÄæ¦ì¦³ÂI..........

  41.         '

  42.         ' ½Æ»s±q¨é°ÓDDE¶×¤J¤§¬Û¹ïÀ³¦ì¸m¸ê®Æ¡A¦p R1C5 ¹ïÀ³ªº¥i¯à¬O¦¬½L»ùµ¥µ¥¡C

  43.         '
  44.         CIndex = Sheets("¤u§@ªí1").Range("A3").Value      ' ********* ¼W¥[³¡¤À  (Counter ­n¥[¤@¡A§_«h¥Ã»·¬°¹s)
  45.     End If
  46. End Sub

  47. Sub onStarter()
  48.     Call Starter
  49.     If actEnabled Then Call actStart
  50. End Sub

  51. Sub actStart()
  52.     actEnabled = True
  53.     ' Application.OnTime (Now + Sheets("¤u§@ªí2").Range("A4").Value), "ThisWorkBook.onStarter"   ' ***** ¤u§@ªí 2 ªº A4 ­þ¨Ó­Ó®É¶¡³]©w¡H
  54.     Application.OnTime (Now + Sheets("¤u§@ªí1").Range("A4").Value), "ThisWorkBook.onStarter"     ' ¼g¤J¸ê®Æªº±Æµ{ (¥Ø«e¬O¨C¹j¤Q¬í¼g¤J¤@¦¸)
  55. End Sub

  56. Sub actStop()
  57.     actEnabled = False

  58.     On Error Resume Next
  59.     Application.OnTime Now, "ThisWorkBook.onStarter", , False
  60. End Sub
½Æ»s¥N½X
DDE-4-14 ½L¤¤ DDE ¦sÀÉ»P VBA ªº¹ê»ÚÀ³¥Î½d¨Ò.rar (14.01 KB)

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD