N
ntwanano
Hi All,
I have been using the basic functions for excel for years now and have onlyrecently needed to work with Macros.
The basic use of the macro will be to add additional products onto an income statement.
For example: In a sheet i will have revenue for each of the individual products as well as costs for the individual products. What i am trying to do is to automatically add a new product into the income statement
I tried to record a macro but it will work in the first instance but the minute i add the second product it will work with the revenue but the costs are not in the same order. I think this is because it fixed the row where i enter the new row which is fine for the revenue as it is at the top but does not work with cost. Here is how is looks
Orginal:
A1:Revenue
A2: Apples
A3: Oranges
A4: Bananas
A5:Costs
A6: Apples
A7: Oranges
A8: Bananas
After running the macro I recorded i get
A1:Revenue
A2ears
A3:Apples
A4: Oranges
A5: Bananas
A6:Costs
A7: Pears
A8: Apples
A9: Oranges
A10: Bananas
This is fine.
The problem occurs when i then add the second new product
A1:REVENUE
A2aw Paw
A3ears
A4:Apples
A5: Oranges
A6: Bananas
A7aw Paw (this is supposed to be under costs)
A8:COSTS
A9: Pears
A10: Apples
A11: Oranges
A12: Bananas
As you can see once i add the second new product it gets inserted above costs and it should be below. So basically i need a evolving macro which is able to do this. Note that this is a basic example as i will be having different kind of costs for each of the products. For example cost will be spilt into fixed and variable costs and this is all calculated in one sheet
Your assistance will be appreaciated
I have been using the basic functions for excel for years now and have onlyrecently needed to work with Macros.
The basic use of the macro will be to add additional products onto an income statement.
For example: In a sheet i will have revenue for each of the individual products as well as costs for the individual products. What i am trying to do is to automatically add a new product into the income statement
I tried to record a macro but it will work in the first instance but the minute i add the second product it will work with the revenue but the costs are not in the same order. I think this is because it fixed the row where i enter the new row which is fine for the revenue as it is at the top but does not work with cost. Here is how is looks
Orginal:
A1:Revenue
A2: Apples
A3: Oranges
A4: Bananas
A5:Costs
A6: Apples
A7: Oranges
A8: Bananas
After running the macro I recorded i get
A1:Revenue
A2ears
A3:Apples
A4: Oranges
A5: Bananas
A6:Costs
A7: Pears
A8: Apples
A9: Oranges
A10: Bananas
This is fine.
The problem occurs when i then add the second new product
A1:REVENUE
A2aw Paw
A3ears
A4:Apples
A5: Oranges
A6: Bananas
A7aw Paw (this is supposed to be under costs)
A8:COSTS
A9: Pears
A10: Apples
A11: Oranges
A12: Bananas
As you can see once i add the second new product it gets inserted above costs and it should be below. So basically i need a evolving macro which is able to do this. Note that this is a basic example as i will be having different kind of costs for each of the products. For example cost will be spilt into fixed and variable costs and this is all calculated in one sheet
Your assistance will be appreaciated