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

§ìWEB¸ê®Æ¥X²{¡uÀ³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~¡v

§ìWEB¸ê®Æ¥X²{¡uÀ³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~¡v

[ª©¥DºÞ²z¯d¨¥]
  • GBKEE(2016/10/17 09:48): »ÝªþÀÉ,¨S¤Hª¾¹D¿ù¦b­þ¸Ì.

Dim xlMonth As String, row As Integer
   
    row = 2              '©ñ¸m¸ê®Æªº°_©l¦C    ¶·§ó§ï
    For yr = 92 To 92   '¨ú±oªº¦~¥÷¾ú¥v¸ê®Æ  µø»Ý­n§ó§ï

        For m = 8 To 12  '¨ú±oªº¤ë¥÷¾ú¥v¸ê®Æ  µø»Ý­n§ó§ï
            xlMonth = Format(m, "00")
            
            
            Sheets(42).Activate
            With ActiveSheet.QueryTables.Add(Connection:="URL;http://siis.twse.com.tw/publish/sii/" & yr & "IRB130_" & xlMonth & ".HTM", Destination:=Sheets(42).Range("o1"))
            '.Name = stockID & "_1"
                .FieldNames = True
                .RowNumbers = False
                .FillAdjacentFormulas = False
                .PreserveFormatting = True
                .RefreshOnFileOpen = False
                .BackgroundQuery = True
                .RefreshStyle = xlOverwriteCells
                .SavePassword = False
                .SaveData = True
                .AdjustColumnWidth = True
                .RefreshPeriod = 0
                .WebSelectionType = xlSpecifiedTables
                .WebFormatting = xlWebFormattingNone
                .WebTables = "2"
                .WebPreFormattedTextToColumns = True
                .WebConsecutiveDelimitersAsOne = True
                .WebSingleBlockTextImport = False
                .WebDisableDateRecognition = False
                .WebDisableRedirections = False
                .Refresh BackgroundQuery:=False
            End With

            
            
            'With ActiveSheet.QueryTables.Add(Connection:= _
            '    "URL;http://siis.twse.com.tw/publish/sii/" & yr & "IRB130_" & xlMonth & ".HTM", Destination:=Range _
            '    ("O1"))
            '    .Name = "92IRB130_08"
            '    .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 = "2"
            '    .WebPreFormattedTextToColumns = True
            '    .WebConsecutiveDelimitersAsOne = True
            '    .WebSingleBlockTextImport = False
            '    .WebDisableDateRecognition = False
            '    .WebDisableRedirections = False
            '    .Refresh BackgroundQuery:=False
            'End With
            
            Cells(row, "B") = Cells(1500, "P")
            Cells(row, "C") = Cells(1500, "S")
            Cells(row, "D") = Cells(1500, "U")
            Cells(row, "E") = Cells(1500, "V")
            Cells(row, "F") = Cells(1500, "W")            
            row = row + 1
   
        Next
    Next

        ÀR«ä¦Û¦b : ¡i¬°µ½Ävª§¡j¤H¥Í­n¬°µ½Ävª§¡A¤À¬í¥²ª§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD