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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
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
 

ashwinivenkob

New Member
Joined
Oct 13, 2006
Messages
2
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
 

ravishankar

Well-known Member
Joined
Feb 23, 2006
Messages
3,566
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
 

Forum statistics

Threads
1,144,518
Messages
5,724,821
Members
422,580
Latest member
ScotIain76

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
Top