This is kind of a repost to reorganize my question but:
I\'m trying to match my spreadsheets cell B1 text with all the cells in the 10th column of a table on a webpage.
We could have more chance for success with this:
Sub sof20255214WebpageCell()
Dim colRows As Object
Dim objDataGrid As Object
Dim xobj1 As Object
Dim element
Dim xcel As Object
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.navigate "http://www.example.com/DataGridPage.php"
While (IE.Busy Or IE.READYSTATE <> 4)
DoEvents
Wend
Set objDataGrid = IE.Document.getElementById("DataGridReservations")
Set colRows = objDataGrid.getElementsByTagName("tr")
For Each element In colRows
Set xcel = element.getElementsByTagName("td")
If Range("B1").Text = xcel.Item(9).innerText Then
Range("H" & (ActiveCell.Row)) = xcel.Item(3).innerText
Else
Range("H" & (ActiveCell.Row)) = "0"
End If
Exit For
Next
IE.Quit
End Sub
Anyway, we cannot use this (BAD):
Set xcel = colRows.getElementsByTagName("td")
As colRows is a collection of rows, but not a single row object. Nevertheless, you can use this (Good):
Set xcel = colRows.Item(0).getElementsByTagName("td")