There is no code, goto Data>From Web, enter the URL for the page, select the table and click Import.
Hi there are around 500+ companies in this website and each information would get displayed after selecting the each company.
Could you please provide a code to automate this and download all the company in a go.
I am actually trying something like this
Dim IE As Object
Sub ASP_Download()
Dim Doc As Object, lastRow As Long, tblTR As Object
Set IE = CreateObject("internetexplorer.application")
IE.Visible = True
navigate:
IE.navigate "
Event Map"
Do While IE.readystate <> 4: DoEvents: Loop
Set Doc = CreateObject("htmlfile")
Set Doc = IE.document
If Doc Is Nothing Then GoTo navigate
lastRow = Sheet1.Range("A65000").End(xlUp).row
If lastRow < 5 Then Exit Sub
For i = 5 To lastRow
Set company = Doc.getelementbyid("ctl00_ctl00_cph1_cph1_ucExhibitorList_dockExhibitorList_C_radExhibitorList_ctl00")
For x = 0 To 250
If company.Options(x).Text = Sheet1.Range("B" & i) Then
company.selectedIndex = x
Set btnCompanyAdd = Doc.getelementbyid("ctl00_ctl00_cph1_cph1_ucExhibitorList_dockExhibitorList_C_radExhibitorList_ctl00_1")
btnCompanyAdd.Click
Set btnCompanyAdd = Nothing
wait
Exit For
End If
Next
Next
wait
Set btnSubmit = Doc.getelementbyid("btnSubmit")
btnSubmit.Click
wait
Set tbldgFunds = Doc.getelementbyid("dgFunds")
Set tblTR = tbldgFunds.getelementsbytagname("tr")
Dim row As Long, col As Long
row = 1
col = 1
On Error Resume Next
For Each r In tblTR
If row = 1 Then
For Each cell In r.getelementsbytagname("th")
Sheet2.Cells(row, col) = cell.innerText
col = col + 1
Next
row = row + 1
col = 1
Else
For Each cell In r.getelementsbytagname("td")
Sheet2.Cells(row, col) = cell.innerText
col = col + 1
Next
row = row + 1
col = 1
End If
Next
IE.Quit
Set IE = Nothing
MsgBox "Done"
End Sub
Sub wait()
Application.wait Now + TimeSerial(0, 0, 10)
Do While IE.readystate <> 4: DoEvents: Loop
End Sub