VBA for a loop calculation

Hi all, I do not know VBA enough.
I'm trying to automate a calculation that takes these steps.
The excel file consists of several similar sheets, but with different number of rows (until more than 2000), and a separate sheet(I will call R) in which there are the results of the model.
For each sheet and for each row the VBA should: 1) replace a number with the value of zero, and 2) read the result of two variables in the result sheet R and copy them into two new columns on the sheet relative to the changed row, 3) change again the modified value in the spreadsheet N, 4) repeat the procedure from step 1 to step 3 on the next line to the end of the rows in that sheet.
This procedure should be done for all the sheets.

I attached two files to show how the structure of data is and how I would like to have the results.

I'd like to specify that the formulas (sum and mean) are only hypotethic, my really interest is to copy the value of them in two specified cells (in this case A2 and B2 in the result sheet).

Thanks in advance for the advice

AttachmentSize
semplified data structure.xls19.5 KB
semplified data structure with results.xls20 KB