Option Explicit
Sub Ex()
Dim i As Integer, E As Object, C As Integer, Sh As Worksheet
With CreateObject("InternetExplorer.Application")
.Visible = True
.Navigate "http://www.goodinfo.tw/stockinfo/ShowK_Chart.asp?STOCK_ID=2454&CHT_CAT2=WEEK"
Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
With .document
Do
If .all.tags("table").Length >= 16 Then Exit Do
DoEvents
Loop
Set Sh = ActiveSheet
Sh.UsedRange.Clear
For Each E In .all.tags("table")(16).Rows
i = i + 1 '
For C = 0 To E.Cells.Length - 1
Sh.Cells(i, C + 1) = E.Cells(C).innertext
Next
Next
With Sh
For i = 21 To .Range("A" & Rows.Count).End(xlUp).Row Step 18
.Cells(i, "A").Resize(2).EntireRow.Delete
Next
End With
End With
.Quit '關閉網頁
End With
End Sub