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

¥Îexcel¤Wºô¬d­µ¼Ð ¤S±¾¤F

¦^´_ 13# GBKEE

³o½d¨Ò,§ÚÁٻݭn¦AGoogle ¤Î®ø¤Æ§l¦¬
¤@ºû°}¦C & UBound(W) ?!
©¡®É­YÁÙ¤£À´¡A¦A½Ð±Ðª©¤j

xi=2 , Mid(A,2,1)=A , Split(1ABCD2ABCD3ABCD4ABCD,A)=1  , A¬°¤À³Î¤§¬É?
xi=3 , Mid(A,3,1)=B , Split(1ABCD2ABCD3ABCD4ABCD,B)=BCD2
xi=4 , Mid(A,4,1)=C , Split(1ABCD2ABCD3ABCD4ABCD,C)=BCD3
xi=5 , Mid(A,5,1)=D , Split(1ABCD2ABCD3ABCD4ABCD,D)=BCD4
xi=6 , Mid(A,3,1)=2 , Split(1ABCD2ABCD3ABCD4ABCD,2)=BCD

TOP

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2012-7-13 15:34 ½s¿è

¦^´_ 13# GBKEE

    ¤£¦n·N«ä!
¦]¬°³o°ÝÃD¬O #4 ¼Óªº©µ¦ù
©Ò¥H³Â·Ðª©¤j¦AÀ°§Ú¬Ý¬Ý
¨ú±o­ì©l½X¬°XÅܼÆ


Left(VBA.Split(.responseText, "filename' value='")(1), InStr(VBA.Split(.responseText, "<table class='noBorder")(1), ">"))
½Ð°Ý,¸Ó¥y»yªk­×©w
  1. Sub EX()
  2. Dim xml As New XMLHTTP
  3. Dim stream As New ADODB.stream
  4. Dim strURL As String
  5. Dim x As String
  6.     strURL = "http://mops.twse.com.tw/mops/web/ajax_t108sb27?step=1&firstin=ture&off=1&TYPEK=sii&co_id_1=&co_id_2=&year=" & _
  7.                 Year(Date) - 1911 & "&month=&b_date=&e_date=&type=1&rulesubmit2=%20%E6%90%9C%E5%B0%8B%20"
  8.         With xml
  9.             .Open "GET", strURL, 0
  10.             .send
  11.             Do While xml.ReadyState <> 4
  12.             Loop
  13.             x = Left(VBA.Split(.responseText, "filename' value='")(1), InStr(VBA.Split(.responseText, "<table class='noBorder")(1), "<"))
  14.         End With
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 11# HSIEN6001
  1. Option Explicit
  2. Sub Ex() 'Split¦b¦r¦ê¤¤¥H«ü©wªº¦r¤¸§@¤À³Î¶Ç¦^¤@ºû°}¦C
  3.     Dim A As String, W, xi As Integer, i As Integer
  4.     A = "1ABCD2ABCD3ABCD4ABCD"
  5.     For xi = 2 To 6
  6.         W = Split(A, Mid(A, xi, 1))
  7.         For i = 0 To UBound(W)
  8.             Debug.Print W(i)     '¦b§Y®É¹Bºâµøµ¡¥i¨£
  9.         Next
  10.         MsgBox Join(W, ",")
  11.     Next
  12. End Sub
½Æ»s¥N½X
¦^´_ 12# c_c_lai
¨Ï¥Î VBA.Split »P ¨ç¼Æ¤§ Split ¹ê°ÈÀ³¥Î¤W¨ì©³¦³¦ó®t²§  ¤@¼Ëªº«áªÌ¥u¬O¬Ù²¤ªº¼gªk

TOP

¦^´_ 2# GBKEE
¶¶±a½Ð±Ð¡G ¨Ï¥Î VBA.Split »P ¨ç¼Æ¤§ Split ¹ê°ÈÀ³¥Î¤W¨ì©³¦³¦ó®t²§¡H

TOP

¥»©«³Ì«á¥Ñ HSIEN6001 ©ó 2012-7-12 20:31 ½s¿è

Sorry ~~§¹¾ãªº¬q¸¨¬O³o¼Ë~~
<input type='hidden' name='filename' value='t108sb27_20120712_17145551.csv'>
<table class='noBorder' align='center' width='100%'><tr><td align='left'>

VBA.Split ¯S§O¬Ý¤£À´
http://msdn.microsoft.com/zh-tw/library/system.string.split.aspx

InStr¨ç数¥iªð¦^¤@个¦r²Å¦ê¦b¥t¤@个¦r²Å¦ê¤¤­º¦¸¥X现ªº¦ì¸m¡C
http://www.w3school.com.cn/vbscript/func_instr.asp
InStr([start,]string1,string2[,compare])

½Ð°Ý...
InStr(VBA.Split(.responseText, "<table class='noBorder")(1)
¤¤ªº(1)¬O¬Æ»ò·N«ä?!

TOP

¦^´_ 2# GBKEE

½Ð°Ý <input type='hidden' name='filename' value='t108sb27_20120712_17145551.csv'>
¨ú¥X³o¬q t108sb27_20120712_17145551.csv
À³¸Ó«ç»ò¤U»yªk¤~¹ï

¥H¤U»yªk,¦³®É·|Err
Left(VBA.Split(.responseText, "filename' value='")(1), InStr(VBA.Split(.responseText, "<table class='noBorder")(1), ">"))
Left(VBA.Split(.responseText, "filename' value='")(1), InStr(VBA.Split(.responseText, "<table class='noBorder")(1), "<"))
¬õ¦â¦rÅé¦ì¸m,®É±`­n§ó¥¿
¬Oªø«×¹Bºâ¿ù»~?!

³o¬q»yªk¤£À´,¥i¥H³Â·Ð«ü¾É¤Îµy¥[»¡©ú?!
Left(VBA.Split(.responseText, "filename' value='")(1), InStr(VBA.Split(.responseText, "<table class='noBorder")(1), ">"))
InStr ¤Î Split ¬d¹L¤FÁÙ¬O¤£À´

~ÁÂÁÂ!!

TOP

¦^´_ 8# Hsieh


    §ÚVBA¬O¦b£¸ª¾¥b¸ÑªºÀ³¥Î http://tw.knowledge.yahoo.com/question/question?qid=1512022306295
©Ò¥H±`±`·d¤£²M·¡
ÁÂÁª©¤j´£¿ô,·P®¦!

TOP

¦^´_ 6# HSIEN6001
.responseText¥²¶·¦bWith xPost.....End With±Ô­z°Ï¬q¤º¤Þ¥Î
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 5# oobird

­è­èµy·L­×§ï¸Õ¤FGBKEE¤jªº»yªk
±Æ°£¤FAlt+Enterªº°ÝÃD

Left(VBA.Split(.responseText, "filename' value='")(1), InStr(VBA.Split(.responseText, "<table class='noBorder")(1), ">"))

ºâ¬O"½M¿ß"~©I§Ë¹ï¤F¶Ü?!
^^

¥t¤@­ÓºÃ°Ý,ÁٽЪ©¤j¶}¥Ü!

TOP

¦^´_ 5# oobird


    oobird ¤j
¦^¶Ç­È,¦h¤F '> ¤Î±j¨î´«¦æAlt+Enter
¥i§_±Æ°£?!

­è­è¹ï·Ó¤@¤U»yªk
¤´Â¤£¸Ñ .responseText
¦b¤§«e¥¼¦ó·|¥X²{"¤£¥¿½Tªº¤Þ¥Î"
¨âªÌVBA °£¤F¦^°é
¦ü¥G®t²§¤£¤j

§Ú¥~¦æ,½Ð¤j¤j´£¥Ü
ÁÂÁÂ!

TOP

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