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

[µo°Ý] ¸ê®Æ§ì¨ú¥t¦s¦b¤£¦Psheet, ¥X²{¿ù»~1004

[µo°Ý] ¸ê®Æ§ì¨ú¥t¦s¦b¤£¦Psheet, ¥X²{¿ù»~1004

¦U¦ì«e½ú¦n
§Ú¬O·s¤â¡A¦b½m²ß®É¸I¨ì¥H¤U°ÝÃD

CommandButton1³]©w¦bsheet1
·QÅý¸ê®Æ¦s¨ú©ñ¦bsheet2

©Ò¥H§Úªº¨BÆJ¦p¤U
1. click CommandButton1
2. ¿ï¨úSheet2¡A¨Ã²M°£Â¦³¸ê®Æ
3. ¶i¤J¥~³¡³sµ²¶×¤J¸ê®Æ¡A¦s©ñ¦bSheet2ªºA1Àx¦s®æ

¦ý°õ¦æ®É«oÅã¥Ü
°õ¦æ¶¥¬q¿ù»~'1004':
À³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~


½Ð°Ý¥H¤Uµ{¦¡À³¸Ó¦p¦ó­×§ï¡H
¦hÁ«ü±Ð

Private Sub CommandButton1_Click()

    Sheets("Sheet2").Select
    Columns("A:AC").Select
    Selection.ClearContents
    Range("A1").Select
    With ActiveSheet.QueryTables.Add(Connection:= _
        "URL;http://mops.twse.com.tw/mops/web/ajax_t51sb01?step=1&firstin=1&TYPEK=sii" _
        , Destination:=Range("$A$1"))
        .Name = "ajax_t51sb01?step=1&firstin=1&TYPEK=sii"
        .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("C:AB").Select
    Selection.Delete Shift:=xlToLeft
   
    Rows("1:1").Select
    Selection.Delete Shift:=xlUp
   
End Sub

¦hÁªO¥D¦^ÂÐ!!

TOP

        ÀR«ä¦Û¦b : ¤Ó¶§¥ú¤j¡B¤÷¥À®¦¤j¡B§g¤l¶q¤j¡A¤p¤H®ð¤j¡C
ªð¦^¦Cªí ¤W¤@¥DÃD