You can do this without VBA pretty simply. I assume you downloaded that .CSV with the zip codes/GPS coordinates.
In your existing spreadsheet with the Physical Addresses, copy/move the "zipcode" worksheet (open in Excel) to your existing sheet. Then, just use:
=IF($B2<>"",INDEX(zipcode!$D:$D,MATCH($B2,zipcode!$A:$A,0)),"")
for Latitude, and =IF($B2<>"",INDEX(zipcode!$E:$E,MATCH($B2,zipcode!$A:$A,0)),"")
for Longitude.
Note that I am assuming your Zip Code will be in column B...adjust the $B2
as needed.
Index/Match (which is similar to VLookup) works by returning some value from an Index. The zipcode!$D:$D
is the list of Latitudes. The Match()
part will tell the Index()
part what Row to use. You're using the value in cell B2
and looking for it's match in the range zipcode!$A:$A
, or the column of Zip Codes. When it finds a match, it returns the row number to the Index()
formula...does that make some sense?
Edit: Here's a screenshot of how to use these. Since they're just formulas, you'll enter directly on your spreadsheet.

So, in your spreadsheet that you want to add the latitude and longitude to, add the formulas. Also make sure you've copied the zipcode.csv
file into your workbook.