Excel to pull data from web

B

Bigpiggy

I am trying to get excel to pull up data from the web off a specific set of
pages.
http://www.cdw.ca/shop/search/results.aspx?key=
http://insight.ca/apps/nbs/index.php?K=
http://www.ncix.com/search/?q=
http://www.tigerdirect.ca/applications/SearchTools/search.asp?keywords=

I tried using a web query but it was really sloppy.
I want to have 1 search value in a cell (B3 for example) and it looks up the
part on each site.
It then posts the first result part description and price in a table on the
main page.

Any Ideas?
 
R

ryguy7272

This recorded macro will do what you want for the first link:

Sub Macro1()

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.cdw.ca/shop/products/default.aspx?EDC=1351281",
Destination:= _
Range("B5"))
.Name = "default.aspx?EDC=" & Range("B3")
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With

End Sub


Follow the logic and modify as appropriate for the other links.

Regards,
Ryan---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top