Hi! I'm new here and have a question. I'm not familiar with macros, but I have created a macro to pull data from a webpage. I want to pull the stock data for multiple stocks using a macro. I have the macro for pulling the financial data for a specific stock, but I want to repeat this process for each stock and put the data on the same page so I can perform calculations on a different page. How would I go about this? I know a lot of you have probably done this before, but I couldn't find anything in the forums. Here is the macro I have made so far:
Sub Stock_Test()
'
' Stock_Test Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.advfn.com/exchanges/NASDAQ/GOOG/financials?btn=annual_reports&mode=company_data" _
, Destination:=Range("$A$2"))
.Name = "financials?btn=annual_reports&mode=company_data"
.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 = "9"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
Thanks!
Bookmarks