need to import a search result on webpage into a worksheet

ashwinivenkob

New Member
Joined
Oct 13, 2006
Messages
2
hello,

i wanted to know how i cud import a webpage into a worksheet using VBA.
After giving some criterias ,search result is displayed on a web page.
I want to open this web page directly as a worksheet in excel.

For Eg:
"http://ABC//XYZ.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&classification=&field0-0-0=noop&type0-0-0=noop&value0-0-0="

The above URL gives a search result.
How can the above URL's webpage be imported into Excel worksheet
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
In excel choose
Data > get external data > new web query > paste your URL (with search tags) and choose entire page and html option.

Your search results will be in excel
but you need to do a lot of clean up work after that

Ravi
 
Upvote 0
Thanks for the reply,

I did the steps given by you,i do get the webpage on excel.
As i need to automate the import,i need to know the VBA code during macro recording.
After recording the macros when i navigate to the VBA editor, instead of the code i can see only a message about when the macro was recorded.
How can i see the VBA code used during the recording of the macro.

Regards,
Ashwini
 
Upvote 0
I tried to record a macro of importing data and it worked.
The following were the macro codes
Macro1 Macro
' Macro recorded 10/16/2006 by P N Maiya
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.google.com/search?hl=kn&q=%22dinesh+baliga%22", Destination:= _
Range("C94"))
.Name = "search?hl=kn&q=%22dinesh+baliga%22_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.LargeScroll ToRight:=-1
ActiveWindow.LargeScroll Down:=2
End Sub

give it a go again. it might work
Ravishankar
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

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