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

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

¦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

¥»©«³Ì«á¥Ñ 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

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

Hello Jerry,

§Úª¾¹D§Úªºµ{¦¡¬°¤°»ò·|¯Ê¸ê®Æ¤F, À³¸Ó¥u­n¥[¤J¦p¤U½XÀ³¸Ó´N¥i¥H¸Ñ¨M¤F.
Worksheets("sheet1").Activate

TOP

¸g¹L #25¼Ó, Á¤jªº«ü¾É»P³o´X¤ÑªºK®Ñ, ²×©ó§âµ{¦¡¤º®eÁYµu¥B²³æ§ï¼g.
¦ý¬O·|¹J¨ì¦p¤U°ÝÃD:

1.  ¦pªG¦P®É¦³¶}¨ä¥LEXCELÀÉ®É, ¥B¨S¦³¥[¤W "Worksheets("sheet1").Activate"ªº¸ÜDataµLªkUpdate¥B·|¦³¿ù»~.
     ¦ý¬O¦pªG¥[¤W¤F"Worksheets("sheet1").Activate", ¶}²Ä¤G­Ó©Î²Ä¤T­Ó¥H¤WªºEXCELÀɮɷ|¨Ì·Ó®É¶¡¤@ª½¸õ¨ì¶]¨ìSheet1.
     Q: ½Ð°Ý¦b¦P®É¶}¨â­Ó¥H¤WªºEXCEL®É, ¦³¨S¦³¥i¥HÅý¸ê®Æ¦Û°Êupdate, ¥B¤£­n¤@ª½¶]¹DSheet1ªº¤èªk ?

2. ¦]¬°°Ñ·Ó®É¶¡ªºÀx¦s®æ¦b09:00:00®É©ÒÅã¥Üªº¬O90000, ¤@ª½¨ì10:00:00®É¤~Åã¥Ü100000
    ­Y¨Ï¥Î " t = Format(TimeValue(Format([C6], "00:00:00")), "hh:mm:ss")" ®É, 90000 - 95900³o¬q´Á¶¡µLªk±Ndata¼g¤J.
    100000 - 125900¥¿±`. 130000 - 133100µLªk±Ndata¼g¤J.
    ­Y¨Ï¥Î " t = Format(TimeValue(Format([C6], "00:00:00")), "h:mm:ss")" ®É90000 - 125900¥i¥H¥¿±`¼g¤Jdata.
    130000 - 133100µLªk¥¿±`¼g¤Jdata, ¥²¶·¦b"G"¦æªºÀx¦s®æ¨Ï¥Î¤å¦r¤è¦¡¤~¥i¥H, ¤]´N¬O¤l¦æ¿é¤J('13:00:00).
    Q: ¥H¤W½Ð°Ý¬O¦³¬Æ»ò½Ä¬ð¶Ü, ¬O§_¦³¤èªk¸Ñ¨M ?

¥H¤W½Ð¦U¦ì¥ý¶i¤£¥O½ç±Ð.

DDE-Test v2-1.zip (31.97 KB)

TOP

        ÀR«ä¦Û¦b : §g¤l¦p¤ô¡AÀH¤è´N¶ê¡AµL³B¤£¦Û¦b¡C
ªð¦^¦Cªí ¤W¤@¥DÃD