Hello Still stuck on a problem. I'm trying to loop through a table on a webpage. I'm referencing my excel sheet's B1 cell. Everytime my B1 value matches the webpage tables first column value. I want to copy a specific cell from that row.
The following code only works for the first row. I suspect the issue is with my line "For z=2 to colRows1.Length - 1"
Any assistance is Greatly appreciated, Thank you!
Dim colRows1 As Object
Dim xobj3 As Object
Dim xobj4 As Object
Dim z As Long
Set colRows1 = IE.Document.getElementById("ctl05_InventoryTransactionControl_BasicDataGridInventoryTransactions").getElementsByTagName("tr")
For z = 2 To colRows1.Length - 1
Set xobj3 = colRows1.Item(z)
Set xobj4 = xobj3.getElementsByTagName("td")
If Range("B1").Text = xobj4.Item(0).innertext Then
Range("I" & (ActiveCell.Row)) = xobj4.Item(7).innertext
End If
Exit For
The following code only works for the first row. I suspect the issue is with my line "For z=2 to colRows1.Length - 1"
Any assistance is Greatly appreciated, Thank you!
Dim colRows1 As Object
Dim xobj3 As Object
Dim xobj4 As Object
Dim z As Long
Set colRows1 = IE.Document.getElementById("ctl05_InventoryTransactionControl_BasicDataGridInventoryTransactions").getElementsByTagName("tr")
For z = 2 To colRows1.Length - 1
Set xobj3 = colRows1.Item(z)
Set xobj4 = xobj3.getElementsByTagName("td")
If Range("B1").Text = xobj4.Item(0).innertext Then
Range("I" & (ActiveCell.Row)) = xobj4.Item(7).innertext
End If
Exit For