Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub GatherAssets()
- Dim XMLReq As New MSXML2.XMLHTTP60
- Dim HTMLDoc As New MSHTML.HTMLDocument
- Dim Asset As MSHTML.IHTMLElement
- Dim Assets As MSHTML.IHTMLElementCollection
- Dim Charter As Integer
- Dim i As Long
- For i = 1 To Rows.Count
- If Not IsEmpty(Cells(i, 1).Value) Then
- Cells(i, 1).Select
- XMLReq.Open "GET", "https://mapping.ncua.gov/SingleResult.aspx?ID=" & Cells(i, 1).Value, False
- XMLReq.send
- If XMLReq.Status <> 200 Then
- MsgBox "problem"
- Exit Sub
- End If
- HTMLDoc.body.innerHTML = XMLReq.responseText
- Set Assets = HTMLDoc.getElementsByTagName("tr")
- Debug.Print "/n/n/n/n\n\n\n---------START-------------\n\n\n/n/n/n/n"
- For Each Asset In Assets
- If InStr(UCase(Asset.innerText), "CREDIT UNION NAME") Then
- ActiveCell.Value = Split(Asset.innerText, ":")(1)
- End If
- If InStr(UCase(Asset.innerText), "ASSETS:") Then
- ActiveCell.Offset(0, 1).Value = Split(Asset.innerText, ":")(1)
- End If
- Next Asset
- XMLReq.abort
- End If
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement