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

EXCEL+DDE

EXCEL+DDE

¤j®a¦n¡A

§Ú·Q¨C¤Ñ§ïÅܧë¸ê²Õ¦X¦¨¥÷ªÑ¡A¦A§â¦Û°Ê§âªÑ­n¥N¸¹µ²¦X¦¨¨é°ÓªºDDE¤½¦¡¡A³o¼Ë´N¤£¥Î³v¤@¥h­×§ï¡A
½Ð¦U¦ìÀ°¦£¬Ý¯à¤£¯à¹F¦¨¡CÁÂÁ¡C

ªÑ²¼¦WºÙ        ¦¬½L»ù        ¦¨¥æ¶q        ¥«»ù
1516¤t­¸        2.21        161        =DDEEXCEL|CSTOCK1516!¥«»ù
6192¥¨¸ô        85.6        3,591        =DDEEXCEL|CSTOCK6192!¥«»ù
2910²Î»â        31.7        233        =DDEEXCEL|CSTOCK2910!¥«»ù
2358¬ü®æ        12        659        =DDEEXCEL|CSTOCK2358!¥«»ù

¨Ò¦p¡J
1516¤t­¸ D2=DDEEXCEL|CSTOCK1516!¥«»ù
A橺1516¤t­¸¥]§tªÑ²¼¥N¸¹©M¦WºÙ¡A¦³¨Ç¥N¸¹¬O6¦ì¼Æ¡A¦WºÙ¬O2~3¦ì¤¤¤å¦r

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-7-26 06:27 ½s¿è

¦^´_ 1# hmc667888

¦Û­q¨ç¼Æ
½Ð±Nµ{¦¡½X ¶K©ó ¤@¯ë¼Ò²Õ (Module1.)
  1. Function ¦¬½L»ù(ªÑ²¼ As Range)
  2.     Dim i As Integer
  3.     For i = 1 To Len(ªÑ²¼)
  4.         If Mid(ªÑ²¼, i, 1) Like "[!0-9]" Then
  5.             ¦¬½L»ù = Application.Evaluate("DDEEXCEL|CSTOCK" & Mid(ªÑ²¼, 1, i - 1) & "!¦¬½L»ù")
  6.             Exit Function
  7.         End If
  8.     Next
  9.     ¦¬½L»ù = ªÑ²¼ & " ¨S¦³¥N¸¹!!"
  10. End Function
  11. Function ¦¨¥æ¶q(ªÑ²¼ As Range)
  12.     Dim i As Integer
  13.     For i = 1 To Len(ªÑ²¼)
  14.         If Mid(ªÑ²¼, i, 1) Like "[!0-9]" Then
  15.             ¦¨¥æ¶q = Application.Evaluate("DDEEXCEL|CSTOCK" & Mid(ªÑ²¼, 1, i - 1) & "!¦¨¥æ¶q")
  16.             Exit Function
  17.         End If
  18.     Next
  19.     ¦¨¥æ¶q = ªÑ²¼ & " ¨S¦³¥N¸¹!!"
  20. End Function
  21. Function ¥«»ù(ªÑ²¼ As Range)
  22.     Dim i As Integer
  23.     For i = 1 To Len(ªÑ²¼)
  24.         If Mid(ªÑ²¼, i, 1) Like "[!0-9]" Then
  25.             ¥«»ù = Application.Evaluate("DDEEXCEL|CSTOCK" & Mid(ªÑ²¼, 1, i - 1) & "!¥«»ù")
  26.             Exit Function
  27.         End If
  28.     Next
  29.     ¥«»ù = ªÑ²¼ & " ¨S¦³¥N¸¹!!"
  30. End Function
½Æ»s¥N½X
¦p¹Ï¥i©ó¤u§@ªí´¡¤J©Ò¼gªº¦Û­q¨ç¼Æ.

TOP

ª©¥DÁÂÁ§A¡C
µ²ªG³£§e²{#VALUE!¡A
¥t¥~"ªÑ²¼"ªº½d³ò­n¥t¥~©w¸q¦WºÙ©Î¥i¥H¼g¤Jµ{¦¡¡C

TOP

¦^´_ 3# hmc667888
¶Ç¤W§AªºÀɮ׬ݬÝ

TOP

¦^´_ 4# GBKEE

§Ú¥ý±N"ªÑ²¼"©w¸q¦WºÙ¡A¨Ã¥[¤Jlinkchange¡A
¤w¸g¥i¥H¥X¨Ó¡A¦ý¦³ÂIºC¡A¤]¤£¤Ó¶¶¡A¦³没¦³¥i¥H§ï¶iªºªÅ¶¡¡AÁٽФj¤jÀ°¦£¡C
"ªÑ²¼"©w¸q¦WºÙ¥i¥H¼g¤JVBA¤¤¶Ü¡H

portfollio.zip (10.66 KB)

TOP

¦^´_ 5# hmc667888
¦ý¦³ÂIºC¡A¤]¤£¤Ó¶¶    ¥i¯à¬OÀɮרϥΪº¨ç¼Æ­pºâ¶q¤Ó¤j
¥i¥Î¥¨¶°¿ý»s¬O¬Ý¬Ý
  1. Sub Macro1()
  2. '
  3. ' Macro1 Macro
  4. '
  5.     Range("A2:A16").Select
  6.     ActiveWorkbook.Names.Add Name:="ªÑ²¼", RefersToR1C1:="=sheet1!R2C1:R16C1"
  7.    
  8. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD