In J1, put ^dji
macro stop at With ActiveSheet.QueryTables.Add(Connection:=StrURL, Destination:=Range("A1"))
Dim StrURL As String
On Error Resume Next
ThisWorkbook.Connections(1).Delete
Err.Clear: On Error GoTo 0
StrURL = "URL;http://ichart.finance.yahoo.com/table.csv?s=" & _
Worksheets("Sheet1").Range("J1").Value & "&a=10&b=13&c=2011&d=06&e=6&f=2013& " & g = "&ignore=.xlsx"
If Range("H1").Value = "" Then
StrURL = StrURL & "&g=w&ignore=.xlsx"
Else
StrURL = StrURL & "&g=m&ignore=.xlsx"
End If
With ActiveSheet.QueryTables.Add(Connection:=StrURL, Destination:=Range("A1"))
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
Bookmarks