torquil
03-17-2020, 08:20 AM
Hi Guys,
I have a code that pulls through a csv file and imports the data into a sheet named "test".
what I want it to do is copy the data into the exisitng cells rather than adding new cells witht the data in.
Dim URL As String Dim destCell As Range
URL = "https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1426550400&period2=1584403200&interval=1d&events=history"
Set destCell = Worksheets("test").Range("A1")
With destCell.Parent.QueryTables.Add(Connection:="TEXT;" & URL, Destination:=destCell)
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh BackgroundQuery:=False
End With
destCell.Parent.QueryTables(1).Delete
End Sub
My goal with this is so i can have a set of 5 or 6 tables of data on a single sheet that will update depending on user search box.
I have a code that pulls through a csv file and imports the data into a sheet named "test".
what I want it to do is copy the data into the exisitng cells rather than adding new cells witht the data in.
Dim URL As String Dim destCell As Range
URL = "https://query1.finance.yahoo.com/v7/finance/download/AAPL?period1=1426550400&period2=1584403200&interval=1d&events=history"
Set destCell = Worksheets("test").Range("A1")
With destCell.Parent.QueryTables.Add(Connection:="TEXT;" & URL, Destination:=destCell)
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh BackgroundQuery:=False
End With
destCell.Parent.QueryTables(1).Delete
End Sub
My goal with this is so i can have a set of 5 or 6 tables of data on a single sheet that will update depending on user search box.