I have a vba code for parsing html table from a web page which works perfectly and gives the desired result.
I need to extract the inner text value in (5th Row and 3 th column) from the code as mentioned below
Any suggestions to extract a single cell value from table would really be helpful .
Please help in the subroutine as mentioned above.
Thanks in anticipation
I need to extract the inner text value in (5th Row and 3 th column) from the code as mentioned below
VBA Code:
Sub Extracttable()
Dim oDom As Object: Set oDom = CreateObject("htmlFile")
Dim x As Long, y As Long
Dim oRow As Object, oCell As Object
Dim data
y = 1: x = 1
With CreateObject("msxml2.xmlhttp")
.Open "GET", "https://www.xe.com/currencytables/?from=USD&date=2020-02-07", False
.Send
oDom.Body.innerHTML = .responseText
End With
With oDom.getElementsByTagName("table")(0)
ReDim data(1 To .Rows.Length, 1 To .Rows(1).Cells.Length)
For Each oRow In .Rows
For Each oCell In oRow.Cells
data(x, y) = oCell.innerText
y = y + 1
Next oCell
y = 1
x = x + 1
Next oRow
End With
Sheets(1).Cells(1, 1).Resize(UBound(data), UBound(data, 2)).Value = data
End Sub
Any suggestions to extract a single cell value from table would really be helpful .
Please help in the subroutine as mentioned above.
Thanks in anticipation