RyuuzakiYu wrote:
公開觀測站的當日重大訊息
看不太懂您的問題,像這樣?

Sub Get_twse_重大訊息()
Dim HTML As Object, Getxml As Object, table As Object, i As Integer, j As Integer, url As String, Url_a As String, ttt As Double, y As String, m As String, d As String, Lastrow As Integer
Set HTML = CreateObject("htmlfile")
Set Getxml = CreateObject("msxml2.xmlhttp")
url = "https://mops.twse.com.tw/mops/web/ajax_t05st02"
Url_a = "https://mops.twse.com.tw/mops/web/t05st02"
Sheets("工作表1").Cells.Clear
Sheets("工作表1").Range("A:C").NumberFormatLocal = "@"
Application.ScreenUpdating = False
y = "112"
m = "04"
d = "25"
ttt = Timer
With Getxml
.Open "POST", url, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "Cache-Control", "no-cache"
.setRequestHeader "Pragma", "no-cache"
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
.send ("encodeURIComponent=1&step=1&step00=0&firstin=1&off=1&TYPEK=all&year=" & y & "&month=" & m & "&day=" & d)
HTML.body.innerhtml = .responsetext
End With
Set table = HTML.all.tags("table")(2).Rows
For i = 0 To table.Length - 1
For j = 0 To table(i).Cells.Length - 1
Sheets("工作表1").Cells(i + 1, j + 1) = Trim(table(i).Cells(j).innertext)
Next j
Next i
Lastrow = i
Set table = HTML.all.tags("table")(3).Rows
For i = 0 To table.Length - 1
For j = 0 To table(i).Cells.Length - 1
Sheets("工作表1").Cells(i + 1 + Lastrow, j + 1) = Trim(table(i).Cells(j).innertext)
Next j
Next i
Sheets("工作表1").Columns.AutoFit
Application.ScreenUpdating = True
Set HTML = Nothing
Set Getxml = Nothing
Set table = Nothing
End Sub