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

[µo°Ý] ½Ð°Ý¦p¦ó±N¥H³s±µEXCELªºDDE¼Æ¾Ú¨C¤ÀÄÁ¬ö¿ý¤U¨Ó¡H

¯u¬O±j©ã¡I
µ¹¥L¦³¬Ý¨S¦³À´
§Ú·|ºÉ§Ö§â¥L§ËÀ´

TOP

¦n¼F®`¡I¡I¡@ÁÂÁ¡I¡@
·Q¾ÇEXECL ªº·s¤H

TOP

¤Ó·P¿E¤F ! ¤]¤Ó·P°Ê¤F !
§Ú¦b¤@ª½¦b´M§ä³o­Ó°ÝÃDªº¸Ñµª
©ó¦b³o¨à§ä¨ì¤F

TOP

¦U¦ì¤j®a¦n,

¦]¬°¤p§Ì¨S¦³VBA¸gÅç, ¦b«ôŪ¥H¤W¤å³¹¤§«áÁÙ¬OÃú·Ù·Ù.
¤£ª¾¹D­n§âDDEªº¸ê®Æ°O¿ý¤U¨Óªº¤èªk°£¤F¨Ï¥ÎVBA¤§¥~,¬O§_¥i¥H¨Ï¥ÎEXCEL¨ç¼Æ¨Ó¹F¦¨©O ?

TOP

¦­¤Wµo¤å«á¬Ý¤F³\¤[EXCELªº®ÑÄy, ¬Ý°_¨Ó¨ç¼ÆÀ³¸ÓµLªk¹F¦¨±NDDE¨Cµ§¬ö¿ý¦bExcelªº¥\¯à,
ÁÙ¬O»Ý­n¾aVBA.

§Ú·Q­n¹F¨ìªº¥\¯à»Pµo°ÝªÌ"J1221"¥ý¥Í¤£¤Ó¤@¼Ë(§Ú¨Ï¥ÎEasyWin DDE),
¥H¤U¬°§Úªº±ø¥ó°ÝÃD, §Æ±æ¦U¦ì°ª¤â¥i¥H¸Ñµª.
1.§ì¨úEasyWin DDE¤¤ªº®É¶¡·í§@¼Æ­È¬ö¿ý¼Ð·Ç, ¦pªþ¥ó"C6"
2.¨Ì·ÓC6ªº®É¶¡±a¥X¨C¤ÀÄÁªº¶R½æ¸ê®Æ"E6" & "F6" («D¥»¾÷¹q¸£®É¶¡)
3.±NE6 & F6¨C¤ÀÄÁªº®É¶¡¬ö¿ý¨ìI2 ~ I273 & J2 ~ J273

³}¤F¤@¤U¤Èªº®Ñ§½, ²³æªº¼g¤F¤@­ÓSample.
¦]¬°§Ú¤£ª¾¹D­n«ç»ò³]¦^°é, ¦pªG«ö·Ó³Ì²³æªº¤è¦¡, ¨C¤@¤ÀÄÁ§PÂ_¤@¦¸, ­n¼g271­Ó§PÂ_¦¡.
¤£ª¾¹D¦U¦ì°ª¤â¬O§_¦³¤èªk¥i¥H´î¤Öµ{¦¡½Xªº¤è¦¡©O ?

ÁÂÁÂ. (ÀH«Hªþ¤W§ÚªºEXCELÀÉ)
DDE-Test.zip (9.66 KB)

TOP

¦^´_ 25# skybbs
  1. Private Sub Worksheet_Calculate()
  2. t = Format(TimeValue(Format([C6], "00:00:00")), "hh:mm:ss")
  3. Set a = Range("H:H").Find(t)
  4. If Not a Is Nothing Then a.Offset(, 1).Resize(, 3) = Array([E6], [F6], [E6] - [F6])
  5. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ skybbs ©ó 2011-1-19 20:22 ½s¿è

¦^´_ 26# Hsieh

·PÁÂHsiehªº¦^ÂÐ, ¦]¬°¬Q¤Ñ§Ú·Q¸Õ¤@¤U§Úªº·Qªk¬O§_¥i¦æ, ©Ò¥H§â§PÂ_¦¡³£Key¤F.
¤µ¤Ñ¤@¦­¬Ý¨ìÁ¤jªº¦^ÂÐ, ¦³¤U­±´XÂI»P¦­¤W´ú¸ÕVBA³¡¥÷ªº°ÝÃD§Æ±æÁ¤j¥i¥H¼·ªÅ¦^ÂÐ.

1. §Ú§â±qDDE®É¶¡®æ§ï¬°B6, ±q09:00¶}©l¨C¤@¤ÀÄÁ§âD6&E6ªº¸ê®ÆCopy¨ìH2.I2.
    09:01®ÉCopy¨ìH3.I3, 09:02®ÉCopy¨ìH4.I4¨Ì¦¹Ãþ±À.
    ½Ð°ÝÁ¤jªºµ{¦¡­n«ç»ò¥i¥H®M¨ì§ÚªºVBAµ{¦¡¸Ì ? ¦³­þ¨Ç³¡¥÷¥i¥H§R°£ªº ?

2. ¦b§ÚªºSheet1¸Ì³£¬O¸ê®Æ, ©Ò¥H§Ú§âsheet1ªº¸ê®Æ¦bSheet2¸Ìµe¹Ï, ¦ý¬Oµo²{¦pªGµe­±¨S¦³¦bSheet1®ÉVBAªºµ{¦¡´N¤£·|°O¿ý¸ê®Æ.
    ½Ð°Ý³o­Ó¦³¸Ñ¶Ü ?

3. ³o­Óµ{¦¡­n¦h¤[(¥Ø«e§Ú³]©w3¬í)°õ¦æ¤@¦¸·|¤ñ¸û«ê·í©O ?

ÀH«Hªþ¤WEXCELÀÉ®×, ·Ð½ÐÁ¤jÀ°¦£¬Ý¤@¤U. ÁÂÁÂ.
DDE-Test v1.zip (43.26 KB)

TOP

Private Sub Workbook_Open()
Sheet2.[B7:J307] = ""
If Time >= TimeValue("08:45:00") And Time <= TimeValue("13:45:00") Then
change
Else
Application.OnTime "08:45:00", "ThisWorkbook.change"
End If
End Sub


Private Sub change()
    Dim TimeRange As Range, Rng As Range, R As Range
    With Sheet2
        Set TimeRange = .[A:A].Find(TimeSerial(Hour(Time), Minute(Time), 0), LookIn:=xlFormulas)
        Set Rng = TimeRange.Offset(, 1).Resize(1, 7)
    End With
    Rng.Value = Sheet1.[N3:T3].Value
    If Time > TimeValue("13:45:00") Then Exit Sub
    Application.OnTime Now + TimeValue("00:01"), "ThisWorkbook.change"
End Sub

³o¬O§Ú¨Ï¥Îªºµ{¦¡½X
§ÚSheet1 ¬O¦b±µ¦¬dde¥[¹Bºâªº  ³£¦³¥¿±`
¥B¸ê®Æ³£¦³¥X¨Ó
¦ÓSheet2´N¬O§â¨C¤ÀÁ骺¸ê®Æ¦s°_¨Ó
¦ýµo²{  ¦³®É¦³1~3¤ÀÁé¨S¦³§ì¨ì¸ê®Æ
´NÅܦ¨ªÅ¥Õ  ¤£¾å±o¬O¤°»ò­ì¦]©O

TOP

Hi Jerry,

¤µ¤Ñ§Ú¥Î§ÚªºVBA¦b§@´ú¸Õ, µo²{¦³¦p¤U°Ê§@®É·|µLªk°O¿ý¸ê®Æ, µ¹±z°Ñ¦Ò.

1. ¦pªG¤£¬O¦b¸Ósheet®É, VBA¦n¹³¤£·|°Ê§@. (³Ì¤p¤ÆOK)
2. ¦pªG¶}¥t¥~¤@­ÓExcel¦b°µ§Oªº¨Æ±¡®É, ¦n¹³VBA¤]¤£·|°Ê§@.

¥H¤W¬O§Ú¤µ¤Ñªºµo²{, ´£¨Ñ°Ñ¦Ò.

TOP

¤j®a¦n¡I§Ú¬O¦bºô¤W§ä¸ê®Æ®Éµo²{¾ªº¤@­Ópost¦Ó¨ì³o¨àªº¡G
http://gb.twbts.com/index.php?topic=9871.0
§Úı±o³o¥¿¬O§Ú§Æ±æ§ä¨ìªºµª®×¡A¤]¥i¯à»P¤j®a°Q½×ªºªF¦è¦³Ãö¡A¥i±¤§Ú¬Ý¤£¨ìªþ¥ó©O...

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD