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

[µo°Ý] ½Ð°Ý¦³¤°»ò¤èªk¥i¥H¦bexcel¤W¦Û°Ê§ó·s¥Ø«e©Ò¦³¤W¥«ÂdªÑ²¼¦¬½L»ù

¦^´_ 21# jsleee


    «D±`·PÁÂ jsleee
¯uªº«D±`ÁÂÁ§A¡A§Ú·|ªá¤@ÂI®É¶¡¦n¦n¬ã¨s¬ã¨s¡C
peter460191

TOP

¤WÂdªº³¡¤À ¦p¤U¡G

Sub ¤WÂd()
    Application.ScreenUpdating = False
    DATE_REQ = CDate(InputBox("½Ð¿é¤J¥æ©ö¤é´Á, ®æ¦¡ 2011/9/6", , Format(Now(), "yyyy/m/d")))
   
    yyymmdd = Year(DATE_REQ) - 1911 & Format(Month(DATE_REQ), "00") & Format(Day(DATE_REQ), "00")
    Application.DisplayAlerts = False
    On Error Resume Next
    Cells.Select
    Selection.QueryTable.Delete
    Selection.ClearContents
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://www.otc.org.tw/ch/stock/aftertrading/DAILY_CLOSE_quotes/RSTA3104_" & yyymmdd & ".html" _
        , Destination:=Range("$A$1"))
        .Name = "RSTA3104_" & yyymmdd & ""
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    Columns("A:A").ColumnWidth = 7
End Sub

TOP

¥iÂà¶Åªº³¡¤À°Ñ¦Ò¦p¤U¡G

Sub ¥iÂà¶Å()
    Application.ScreenUpdating = False
    DATE_REQ = CDate(InputBox("½Ð¿é¤J¥æ©ö¤é´Á, ®æ¦¡ 2011/9/6", , Format(Now(), "yyyy/m/d")))
   
    yyyymmdd = Year(DATE_REQ) & Format(Month(DATE_REQ), "00") & Format(Day(DATE_REQ), "00")
    Application.DisplayAlerts = False
   
    On Error Resume Next
    Cells.Select
    Selection.QueryTable.Delete
    Selection.ClearContents
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://www.otc.org.tw/ch/inc/js/ReportCSV.php?NAME=/ch/bond_trading_info/bonds_info/daily/data/rsta0113." & yyyymmdd & "-C.csv&SHOW=1&LEVEL=4" _
        , Destination:=Range("$A$1"))
        .Name = "rsta0113." & yyyymmdd & "-C.csv&SHOW=1&LEVEL=4_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    Columns("A:A").ColumnWidth = 17.75
End Sub

TOP

¿³Âdªºµ{¦¡½X¦p¤U¡G

Sub ¿³Âd()
    On Error Resume Next
    Cells.Select
    Selection.QueryTable.Delete
    Selection.ClearContents
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://nweb.gretai.org.tw/emgstk/ch/emgstk.htm", Destination:=Range( _
        "$A$1"))
        .Name = "emgstk_1"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlEntirePage
        .WebFormatting = xlWebFormattingNone
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    Columns("A:A").ColumnWidth = 15.88
    Columns("B:B").ColumnWidth = 13.13
End Sub

TOP

¦^´_ 16# jsleee

·PÁ  jsleee
«ö·Ó©Ò´£¨Ñªºµ{¦¡¯uªº¥i¥H¥Î­C!
¦ý¦n¹³¥u¦³¤W¥«ªº¡A¦pªG·Q­n¤W¥«¥[¤WÂd¡B¿³Âd¤Î¥iÂà¶Å(CB)­n¦p¦ó­×§ï,ÁÂÁ±zªº«ü¾É¡C
peter460191

TOP

¥H¤Uªºµ{¦¡½X´£¨Ñ°Ñ¦Ò......


Sub ¦¨¥æ¸ê°T¨ú±o()
    Application.ScreenUpdating = False
    DATE_REQ = CDate(InputBox("½Ð¿é¤J¥æ©ö¤é´Á, ®æ¦¡ 2011/9/6", , Format(Now(), "yyyy/m/d")))
   
    yyyymm = Year(DATE_REQ) & Format(Month(DATE_REQ), "00")
    yyyymmdd = Year(DATE_REQ) & Format(Month(DATE_REQ), "00") & Format(Day(DATE_REQ), "00")
    yyymmdd = Year(DATE_REQ) - 1911 & "/" & Format(Month(DATE_REQ), "00") & "/" & Format(Day(DATE_REQ), "00")
    Application.DisplayAlerts = False
    Cells.Select
    Selection.ClearContents
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/genpage/Report" & yyyymm & "/A112" & yyyymmdd & "ALLBUT0999_1.php?select2=ALLBUT0999&chk_date=" & yyymmdd & "" _
        , Destination:=Range("A1"))
        .Name = "04"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .WebSelectionType = xlSpecifiedTables
        .WebFormatting = xlWebFormattingNone
        .WebTables = "10"
        .WebPreFormattedTextToColumns = True
        .WebConsecutiveDelimitersAsOne = True
        .WebSingleBlockTextImport = False
        .WebDisableDateRecognition = False
        .WebDisableRedirections = False
        .Refresh BackgroundQuery:=False
    End With
    Columns("A:A").ColumnWidth = 9.63
    Rows("4:4").Select
    Selection.Delete Shift:=xlUp
    Range("C4").Select
end sub

TOP

¦^´_ 13# GBKEE


    «D±`ÁÂÁÂGBKEE ª©¥D
peter460191

TOP

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

¦^´_ 12# peter460191
§Aªº°ÝÃD¤w¦b http://forum.twbts.com/thread-3704-1-1.html °Q½×¹L
§Úªº¯à¤O¥u¯àÀ°§A¶×¤J¤å¦r

TOP

¦^´_ 11# GBKEE


  
ÁÂÁª©¥D,ªþ¥óÀɮפw½s¿è¹L¡A¦ýµL®Ä¡A½Ðª©¥DÀ°À°¦£!


³sµ²ºô§}¡G http://mis.twse.com.tw/stock_category.html
¦b¡yA6Àx¦s®æ¡z¤w¦³¶×¤J¥~³¡¸ê®Æ¡A¦ýµLªkÅã¥Ü¸ê®Æ¡A¥H«e¥i¥H¦ý§ïª©¤§«á´N¤£¦æ¥Î¤F

¥~³¡³sµ².rar (1.89 KB)

peter460191

TOP

¦^´_ 10# peter460191
½Ð°Ý±z¦³¤èªk¥i¥H³sµ²¥æ©ö©Òºô¯¸ªºªÑ»ù¸ê°T¶Ü?
A:½Ð§A§ä¨ì³sµ²¥æ©ö©ÒªÑ»ù¸ê°Tªººô¯¸,ªþ¤W©Ò»Ý¨Dªº½d¨ÒÀÉ®×°Q½×.
³o¸Ì¬O¤@¯ë°Ï , VBA»yªk¦b µ{¦¡°Ï¦³±Mªùªº°Q½×

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD