Sub GetTableData()
Dim objIE As Object
Dim htmlDoc As Object
Dim tableEle As Object
Dim trEle As Object
Dim tdEle As Object
Dim rowCnt As Integer
Dim colCnt As Integer
Dim dataAry() As String
Dim i As Long, j As Long
' インスタンスを作成
Set objIE = CreateObject("InternetExplorer.Application")
' IE を非表示に設定
objIE.Visible = False
' ページを取得
objIE.navigate "https://www.imocwx.com/week.php"
' 待機処理
Do While objIE.Busy Or objIE.readyState <> 4
DoEvents
Loop
' HTML ドキュメントを取得
Set htmlDoc = objIE.document
' テーブル要素を取得
Set tableEle = htmlDoc.getElementsByTagName("tbody")(0)
' 行の要素を取得
Set trEle = tableEle.getElementsByTagName("tr")
' 行数と列数を取得
rowCnt = trEle.Length
colCnt = trEle(1).getElementsByTagName("td").Length
' 2次元配列をリサイズ
ReDim dataAry(1 To rowCnt, 1 To colCnt)
' テーブルデータを2次元配列に格納
'部分的にほしい場合はFor i = 2 To rowCnt or colCntを適宜変更
For i = 2 To rowCnt
Set tdEle = trEle(i).getElementsByTagName("td")
For j = 2 To colCnt
On Error Resume Next
dataAry(i, j) = tdEle(j - 1).innerText
Next j
Next i
' 2次元配列のデータをExcelシートに書き込む
For i = 1 To UBound(dataAry, 1)
For j = 1 To UBound(dataAry, 2)
Cells(i, j).Value = dataAry(i, j)
Next j
Next i
objIE.Quit
Set objIE = Nothing
End Sub