View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default How to create a macro to replace one line with a few new lines?

In reality, do you have far more data than this? If so, please give
further details.

Pete

On Jun 17, 7:48*am, Binyaaust
wrote:
I have an Excel technical problem to split the cost between divisions. Please
help to create a macro to replace my manual process.

e.g. I have the following data
Division * * * *Cost
General 100
Admin * * * 150

If the Division is General, the cost need be split by Key 1, if it is Admin,
split by Key 2, and the original lines will be replaced by three different
lines

* * * * Division A * * *Division B * * *Division C
Key1 * *50% * * 30% * * 20%
Key2 * *70% * * 0 * * * 30%

the result:

Division * * * *Cost
Division A * * *50
Division B * * *30
Division C * * *20
Division A * * *105
Division B * * *0
Division C * * *45

Please help! Thanks!!