I have created a calculation routine consisting of different calculations with various inputs. These different inputs are al linked to a specific product. I want to create a Marco to automatically calculate the calculation routine for various products.

For example:

There is 1 input sheet with inputs of Price (P), Quantity (Q) and Margin (%) (M) for 3 products (X,Y,Z).
There is one calculation sheet with two calculation blocks.
In the first calculation block I calculate the revenue of a specific product X using an input for Price and an input for Quantity specifically for the product X. Lets say in Cell A1 of the calculation sheet I link the P of product X and in Cell A2 I link the Q of product X. In cell A3 I use the formula = A1 * A2 to get the revenue for product X.

In cell A4 I link the M of product X and in cell A5 I use the formula = A3 * A4 to get the Gross Margin. There are two calculations made in this worksheet.

I want to use a marco to automatically change the input of the cells A1, A2 and A4 to calculate this routine also for the products Y and Z and tranfer the different outcomes to an output worksheet.

Could someone advice me on the way to create a Marco that automatically calculates the different revenues and gross margins of the 3 products?