CuriousFox
New Member
- Joined
- Nov 1, 2022
- Messages
- 4
- Office Version
- 365
- Platform
- Windows
Hello!
I'm pulling from Yahoo Finance the historical stock prices. You can only get with Power Query 100 lines. I have downloaded the history in one sheet and I have the Power Query with the last 100 days in another sheet. I would like to have a macro that pastes the new values into the history sheet only if they come after the values already saved in the history.
For example below in Table 0 it should only copy into Sheet1 the last month:
My knowledge of VBA is quite basic, and I can only make a normal copy paste as below. Could any genious please help me with the correct and more complex VBA to achieve it?
Sub valuepaste()
Worksheets("AAPL").Range("Table_0").Copy
Worksheets("Sheet1").Range("A2").PasteSpecial Paste:=xlPasteValues
End Sub
Infinite thanks
I'm pulling from Yahoo Finance the historical stock prices. You can only get with Power Query 100 lines. I have downloaded the history in one sheet and I have the Power Query with the last 100 days in another sheet. I would like to have a macro that pastes the new values into the history sheet only if they come after the values already saved in the history.
For example below in Table 0 it should only copy into Sheet1 the last month:
My knowledge of VBA is quite basic, and I can only make a normal copy paste as below. Could any genious please help me with the correct and more complex VBA to achieve it?
Sub valuepaste()
Worksheets("AAPL").Range("Table_0").Copy
Worksheets("Sheet1").Range("A2").PasteSpecial Paste:=xlPasteValues
End Sub
Infinite thanks