Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to " query for data from a web page"?

Status
Not open for further replies.

i2trader

Technical User
Oct 6, 2009
10
US
I have several hundred fund symbols. I know how to use the Query and find the data and import it one at a time. But, is there away to do this automate this process so it runs in the back ground and refreshes the data when you open the Excel workbook? I am using excel 2003.
 


Hi,
I know how to use the Query and find the data and import it one at a time.
Turn on your macro recorder and record adding a QueryTable to a new sheet.

Post back with your recorded code.

What data element(s) will you be returning from the query?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I hope this is what you needed. There is one thing I don't need that is to include the date, open etc ( the field area for every symbol) just one heading would be fine.


Date Open High Low Last Change % Change
10/21/2009 12.86 12.86 12.86 12.86 0.03 0.23%


Sub get_price()
'
' get_price Macro
' Macro recorded 10/22/2009 by George Valletta
'
' Keyboard Shortcut: Ctrl+g
'
ActiveWorkbook.Worksheets.Add
With ActiveSheet.QueryTables.Add(Connection:= _
"URL; Destination:= _
Range("A1"))
.Name = "quote.asp?sym=aperx&code=BSTK"
.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 = "21"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
 


Where do you want to report EACH of the symbols? Describe.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Ok - you need to Share the file on Boxnet, and post the shared link, not the file manager link ...
 
Did the link work for you or is there something I am missing?

G
 


Nothing there!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I would like to allow you to be one of my collaborators, but I can't fill out this form without your email address. Other that that I don't know what to do.

George

People you are collaborating with Import Contacts Add Collaborators Collaborators close close
Invite collaborators to share with you:
Follow these 3 quick steps to invite people to share files inside your box
1. Folder to share: Select a folder in your Box Select or create a folder to share
Or, make new folder
We'll send an invitation to collaborators you choose
2. Emails to invite:
Type emails separated by commas here___
Access type: EditorViewer
They can now share or view files in this folder with
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top