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

[µo°Ý] 2014Âd¶R§ïª©

[µo°Ý] 2014Âd¶R§ïª©

¦U¦ì¥ý¶i¦n¡A¸ÕµÛ¥Î¾ú¥v¸ê®Æ§@JS¨ú±o¸ê®Æ
2014Âd¶R§ïª© ¤@¨Ç«e½úªº¤ß¦å³£¤£¯à¥Î¤F ¥i±¤
¥i¬O¥u¯à¨ú±oªíÀY¡A¥i§_«üÂI¬O­þ¸Ì¥X¿ù~:)

Sub WEBQ()
    Dim ptxt As String
    Dim yy, stock
    Sheet1.Activate
    If Sheet1.QueryTables.Count = 0 Then
        Sheet1.QueryTables.Add Connection:="URL;", Destination:=Range("A1:E1")
    End If
    yy = InputBox("¿é¤J¬d¸ß¤ë¥÷", "°ê¦~/¤ë¥÷")
    If yy = "" Then Exit Sub
   
    stock = InputBox("¿é¤JªÑ²¼¥N½X", "­ÓªÑ")
    If stock = "" Then Exit Sub
    With Sheet1.QueryTables(1)
        .Connection = "URL;http://www.otc.org.tw/ch/emergingstock/single_historical/result.php"
        .PreserveFormatting = False
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebDisableDateRecognition = True
        .PostText = "ajax=true&input_month=" & yy & "&stk_code=" & stock
        .Refresh False
    End With
End Sub

Ãä·QÃäµo §Ñ¤Fªþ¥ó~:)
testQuery.rar (16.7 KB)

TOP

¦^´_ 1# pbchen

.PostText = "ajax=true&input_month=" & yy & "&input_emgstk_code=" & stock

TOP

¦^´_ 3# stillfish00

¦hÁ¬í¦^
¤£¹L¤@ª½¶}±Ò¤£¤F®a¤¤ªº ¶}µo¤H­û¿ï¶µ
¥u¯à©ú¤Ñ¦A¸Õ¤F ¦A¦¸·PÁÂ~:handshake

TOP

¦^´_ 3# stillfish00
¦æ®a¤@¥X¤â¡A´Nª¾¦³¨S¦³

À´ªº´Nª¾¹D

ÁöµM§Ú²{¦b¤£§ì¤F

TOP

¤@¸Õ§Y¦¨ ¦hÁ¤Ӥӫü±Ð
­ì¨Ó¬OJS¸Ì­±ªº¦WºÙ¦³»~
¤À¨Éµ¹¦³»Ý­nªº¦P¾Ç
testQuery2.rar (18.38 KB)


±µµÛ¶}©l¾Ç¤U¤@¶¥¬q:)

TOP

§Ú¤]¨Ó´ú¸Õ¤@¤U¡Aªº½T¥i¥Hwork!
¦ý¬O
.WebSelectionType = xlEntirePage
·|§ì¤Ó¦h¤£¥²­nªº¸ê®Æ
---------------------
Sub WEBQ()
' ¿³Âd­ÓªÑ¾ú¥v¦æ±¡

    Dim ptxt As String
    Dim yy, stock
    Sheet1.Activate
    If Sheet1.QueryTables.Count = 0 Then
        Sheet1.QueryTables.Add Connection:="URL;", Destination:=Range("A1:E1")
    End If
    'yy = InputBox("¿é¤J¬d¸ß¤ë¥÷", "°ê¦~/¤ë¥÷")
    yy = "103/02"
    If yy = "" Then Exit Sub
   
    'stock = InputBox("¿é¤JªÑ²¼¥N½X", "­ÓªÑ")
   '4990 ´¹¬ü
    stock = "4990"
    If stock = "" Then Exit Sub

    With Sheet1.QueryTables(1)
        .Connection = "URL;http://www.gretai.org.tw/ch/emergingstock/single_historical/history.php"
        .PreserveFormatting = False
        .WebSelectionType = xlAllTables
        .WebFormatting = xlWebFormattingNone
        .WebDisableDateRecognition = True
        .PostText = "ajax=true&input_month=" & yy & "&input_emgstk_code=" & stock
        .Refresh BackgroundQuery:=False
    End With
'
End Sub
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬O­Ó¤p§¾«Ä¡I

TOP

¦^´_ 3# stillfish00
¯uªº«Ü¼F®`¡A¹L¥h§Ú³£¬Ýºô­¶¤º®e©Ç¤£±o¤U¿ù°Ñ¼Æ¡A­ì¨Ó¬O­n[ÀË´úºô¸ô­n¨D]¡A¬d¬Ý[½Ð¨D¤º®e]­n³o¼Ë§ä¤~¯à§ä¨ì¯u¥¿ªº°Ñ¼Æ¡C
Thanks!:lol
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬O­Ó¤p§¾«Ä¡I

TOP

¦^´_ 5# joey0415
ªGµM³£¬O¦æ®a¡A¥»¨Ó§ÚÁÙ¦b©ê«èµÛ¬°¤°»ò¤£»¡²M·¡¤@ÂI¡A­ì¨Ó¬O¦Û¤v¬O²Â©å¤£·|¥Îºô­¶¶}µo¤u¨ã¡Aªá¤F¤@ÂI®É¶¡¤~ºN¨ì¥ÛÀY¹Lªe¡A§A­Ì³£¬O§Úªº¦Ñ®v§r¡I
«Ü©êºp¡A§Ú¬O¤p¾Ç¥Í¡A¤£¯à¤U¸üÀɮסA¬O­Ó¤p§¾«Ä¡I

TOP

½Ð°Ý°ª¤â:)
°ò©ó­ì¬d¸ßµ{¦¡WebQ000µ{¦¡
§Ú¤S¼g¤F¤@­Ó¦Û°Ê¤À­¶ªºµ{¦¡Addpage000
·Q¹ê²{
1.¨Ì¦W³æ"list"¦Û°Ê²£¥Í"ªÑ¸¹§O"¤À­¶
2.°»´ú¬°¨C¤À­¶ªÅ¥Õ«á¦Û°Ê¶K¤W¸ê®Æ
½Ð°Ý¬O­þ¸Ì¥X¤F¿ù?
¥i§_«üÂI¤@¤U~?
-------------------------

Sub Addpages000()               'OKªº¦Û°Ê¤À­¶
Dim ii, yy                     'ii¦Û°Ê¼Ælist  yy¦~/¤ë
Dim stock                      'stockªÑ¸¹»Pªí¦W
Dim ptxt As String             '³s½u¥Î
ii = 2                         '°_©l
yy = 103 / 1                   '¥ý¥Î©w¼Æ

Do While Worksheets("list").Cells(ii, 1) <> ""
    stock = Worksheets("list").Cells(ii, 1)
    Worksheets.Add
    ActiveSheet.Name = stock
   
    Application.Wait Now + TimeValue("00:00:01")         'wait 1s
   
    ii = ii + 1
Loop
   
End Sub



Sub WebQ000()                                                                'OKªººô¸ô¬d¸ß

    Dim ptxt As String
    Dim yy, stock
    Dim ii
   
    ii = 2
    yy = 103 / 1
    stock = Worksheets("list").Cells(ii, 1)
   
   
    If Worksheets("list").Cells(ii, 1) = 0 Then
        Worksheets(ii).Selection
        ActiveSheet.QueryTables.Add Connection:="URL;", Destination:=Range("A1")
        .Connection = "URL;http://www.otc.org.tw/ch/emergingstock/single_historical/result.php"
        .PreserveFormatting = False
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebDisableDateRecognition = True
        .PostText = "ajax=true&input_month=" & yy & "&input_emgstk_code=" & stock
        .Refresh False
   
        Application.Wait Now + TimeValue("00:00:01")         'wait 1s
   
         ii = ii + 1
    Else: Exit Sub
    End If
-----------------------------------------------
test004¦Û°Ê¤À­¶Àx¦s.rar (14.86 KB)

TOP

        ÀR«ä¦Û¦b : ¶¢¤HµL¼Ö½ì¡A¦£¤HµL¬O«D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD