Hello,
I am trying to download a balance sheet form advfn.com. My macro works fine, however, instead of the ticker always being ADM, I need it to be whatever is in cell A1. Please help. Here is my code:
Sheets("Statement of Cash Flows (QTR)").Select
Range("B1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.advfn.com/p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=NYSE%3AADM&istart_date=64" _
, Destination:=Range("$B$1"))
.Name = _
"p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=NYSE%3AADM&istart_date=64"
.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 = "20"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-9
End Sub
I am trying to download a balance sheet form advfn.com. My macro works fine, however, instead of the ticker always being ADM, I need it to be whatever is in cell A1. Please help. Here is my code:
Sheets("Statement of Cash Flows (QTR)").Select
Range("B1").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.advfn.com/p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=NYSE%3AADM&istart_date=64" _
, Destination:=Range("$B$1"))
.Name = _
"p.php?pid=financials&btn=istart_date&mode=quarterly_reports&symbol=NYSE%3AADM&istart_date=64"
.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 = "20"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-9
End Sub