Fetching data from website and feed it in the desired cells

Rahulkr

Board Regular
Joined
Dec 10, 2019
Messages
66
Office Version
  1. 2010
Platform
  1. Windows
Dear,
Please help me out to retrieve data from this website and feed those data into the excel Any help will be appreciated . I am trying on this below codes, but not getting the success

VBA Code:
Sub Scrape_Stats()
 'Create Internet Explorer Browser
 Dim appIE As Object
 Set appIE = CreateObject("internetexplorer.application")
 
 'Ask Browser to navigate to website (.Visible=False will hide IE when running)
 With appIE
 .Navigate "https://transferwise.com/sg/swift-codes/bic-swift-code-checker?code="
 .Visible = True
 End With
 
 'Have the macro pause while IE is busy opening and navigating
 Do While appIE.Busy
 DoEvents
 Loop
 
 'Designate the table to be extracted
 Dim contentDiv As Object
 Set contentDiv = appIE.Document.getElementById("placeholder")
 Dim dataTable As Object
 Set dataTable = contentDiv.getElementsByTagName("d-block")(1)
 
 'Close IE and clear memory
 appIE.Quit
 Set appIE = Nothing
 
 'Clear area and paste extracted text into the appropriate sheet/cells
 Worksheets("Sheet1").Range("B2").ClearContents
 Sheets("Sheet1").Select
 Range("B2").Select
End Sub

I am having the following type of excel sheet as below.
I want if BIC Code is filled then automatic Bank details get filled in all the columns as desired.

BIC CodeBank NameLine2 AutoLine 3 AutoLine 4 Auto
AACIFRP1XXXABN AMRO COMMUNICATIONS INTERNATIONALESPARISFRANCE
 
tHIS

Thank you very much for the modification, it actually worked, but each and every time I have to run the macro manually, I want if the code is filled and pressed ENTER then all data automatically filled. If possible please provide me for the same.
Dear friend, have you made any changes, it is not working, I have tried but again I have to run the macro every time.
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top