Help with VBA code for Excel

garganod1

New Member
Joined
Oct 24, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello, I have created an excel workbook (Macro enabled) that has zip codes in column "B" (the zip codes are non hyperlinked and numeric only). I am trying to have the following action automated:

Function 1 - To have excel open an internet browser and lookup the website in Cell "H2", "www.crimegrade.org" then get the zip code from Cell "B2", and enter it in the search field on the webpage then return the value or grade that is the response generated (You will find the grade by scrolling down below the map above the words "Overall Crime Grade") from the search and populate the column in "H2" and center the reply and also format the reply in Non-Bold type with font Calibri 11 pt. and repeat this function all the way down the sheet until the last row which is in this case "Row 423"

Function 2 - To have excel open an internet browser and lookup the website in Cell "I2", "www.niche.com" then get the zip code from Cell "B2", and enter it in the search first search field on the webpage (the one on the left). then return the value or grade that is the response generated from the search (You will find the search result just below the map above the words "Overall Niche Grade" and populate the column in "I2" and center the reply and also format the reply in Non-Bold type with font Calibri 11 pt. and repeat this function all the way down the sheet until the last row which is in this case "Row 423" If no letter grade is returned I will need to fill that with the term "No Data".

Function 2 - To have excel open an internet browser and lookup the website in Cell "J2", "https://www.realtor.com/realestateandhomes-search/60002/overview" then get the zip code from Cell "B2", and enter it in the search first search field on the webpage (the one on the left). then return the "Median Sold Home Price" that is the response generated from the search (You will find the search result just below the words "Home values in" (It will be the 3rd dollar value from the left, and populate the column in "J2" and center the reply and also format the reply in Non-Bold type with font Calibri 11 pt. and repeat this function all the way down the sheet until the last row which is in this case "Row 423" If no letter grade is returned I will need to fill that with the term "No Data".

Thank you in advance with your help on this.

Zip CodeZip Code NumericCity / Town NameCounty 1County 2County 3County 4Crime crimegrade.orgSchools www.niche.comMedian Sales Price Realtor.com
www.crimegrade.orgwww.niche.comwww.Realtor.com
ZIP Code 6000260002AntiochLakeNo Other CountyNo Other CountyNo Other CountyA -B+$ 272,500.00
ZIP Code 6000460004Arlington HeightsCookNo Other CountyNo Other CountyNo Other CountyAA+$ 377,500.00
ZIP Code 6000560005Arlington HeightsCookNo Other CountyNo Other CountyNo Other CountyB+A+$ 305,000.00
ZIP Code 6000660006Arlington HeightsCookNo Other CountyNo Other CountyNo Other CountyA -No DataNo Data
ZIP Code 6000760007Elk Grove VillageCookDupageNo Other CountyNo Other CountyCA -$ 320,000.00
ZIP Code 6000860008Rolling MeadowsCookNo Other CountyNo Other CountyNo Other CountyC -A$ 221,000.00
ZIP Code 6000960009Elk Grove VillageCookNo Other CountyNo Other CountyNo Other CountyC -No DataNo Data
ZIP Code 6001060010BarringtonLakeCookKaneMcHenry
ZIP Code 6001160011BarringtonLakeNo Other CountyNo Other CountyNo Other County
ZIP Code 6001260012Crystal LakeMcHenryNo Other CountyNo Other CountyNo Other County
ZIP Code 6001360013CaryMcHenryLakeNo Other CountyNo Other County
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Well you've come to the right place because many people have posted similar queries, and there is quite a lot of sample code here which you can use to pull together a solution to your particular webscraping goals (link). Also, I'd recommend checking out the Wise Owl webscraping videos on Youtube.

Hope that helps!
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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