Hello I have this program that will get data from yahoo finance in one sheet then choose the numerical data and then paste it in the my first sheet under the ticker.
Sub fundamentals()
For i = 2 To Sheets(1).Cells(1, 1).End(xlToRight).Column
ticker = Sheets(1).Cells(1, i)
qurl = "https://finance.yahoo.com/quote/" & ticker & "/key-statistics?p=" & ticker & ""
Sheets(2).Select
Sheets(2).Cells.Clear
With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl, Destination:=Sheets(2).Range("A1"))
.BackgroundQuery = True
.Refresh BackgroundQuery = False
End With
Sheets(2).Range("B1:B67").Copy
Sheets(1).Select
Cells(2, i).Select
ActiveSheet.Paste
CutCopyMode = False
Next i
End Sub
It works fine but until it should paste it self to my first sheet, it does not work but in the left corner it says press enter to select destination or paste. I want to make it work automatically so it paste by itself.
Kind regards