I'm pretty new to VBA.
I have two sheets. The first is an old large sheet with outdated information and the second contains a subset of the first one with updated data.
Here is a (truncated) example of each sheet.
**Old Large Sheet**
Year Month Region Data1 Data2 CalculatedData1 CalculatedData2
2016 1 1 X1 Y1 X1 X1/Y1
2016 2 1 X2 Y2 X1+X2 X2/Y2
2016 3 1 X3 Y3 X1+X2+X3 X3/Y3
...
2017 1 1 X13 Y13 X13 X13/Y13
...
2025 12 30 XXX YYY ...
And the new sheet.
**New Sheet**
Year Month Region Data1 Data2
2017 1 1 X13' Y13'
2017 2 1 X14' Y13'
2017 3 1 X15' Y15'
2017 4 1 X16' Y16'
Basically, I would like to replace "Data" columns in the old sheet with values from the new sheet based on an index/match of the three first columns.
In Excel, this would mean filtering for a specific period/region and writing an array formula in Data a formula which would be like
{=INDEX('NewSheet'!D2:D1000;MATCH($A2&$B2&$C2;_
'NewSheet'!$A$2:$A$1000&$B$2:$B$1000&$C$2:$C$1000;0))}
And copying it for each "Data" column and each filtered row.
My question is : how can I do this replacement in VBA in a pretty automated way ?