Dim IE As InternetExplorer
Set IE = New InternetExplorer
Set elemCollection = IE.Document.getElementsByTagName("Table")
For t = 0 To elemCollection.Length - 1 ' start with table 2 which holds negotions if first table then make t start at 0
For r = 0 To elemCollection(t).rows.Length - 1
For c = 0 To elemCollection(t).rows(r).Cells.Length - 1
If InStr(1, elemCollection(t).rows(r).Cells(c).Innertext, "Next 50") Then
Debug.Print
ElementID2 = Rtn_ElementID(IE, elemCollection(t).rows(r).Cells(c).Innertext) ; this is where i get 0 back
IE.Document.getElementsByName(ElementID2).Item.Click
GoTo foundnext50
End If
Next c
Next r
Next t
Function Rtn_ElementID(IEIn As InternetExplorer, SearchFor As String, Optional ByVal count As Integer = 1) As Variant
Dim doc, element
Set doc = IEIn.Document
Dim i As Integer
i = 1
'loop through all elements till we find a match
For Each element In doc.all
If Len(element.ID) <> 0 Then
If element.Innertext = SearchFor Then
count = count - 1
If count = 0 Then ' find proper occurance
Rtn_ElementID = element.ID
Exit Function
End If
' here is the html code</script></td><td valign="middle" nowrap><a onclick="_navBarSubmit('DefaultFormName', 'goto','N4',1,'51', '50','ResultTable');return false" href="#" class="x41">Next 50</a></td><td><script>t(5,1)</script><script> if(DanaFlushWrite) DanaFlushWrite();
</script></td><td valign="middle"><a onclick="_navBarSubmit('DefaultFormName', 'goto','N4',1,'51', '50','ResultTable');return false" href="#"><img
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.