Hi,
I'd like to be able to create VBA which will insert a row based on a cell reference (for that row number) and will use spacing to insert the same row at say a spacing of 5.
Basically the issue is if a line is added to say a P&L (in this case Overheads), then for n number of companies each of there P&L's need a new line inserted so believe a VBA should be able to make this quicker.
Hopefully the example below is clear, I'm not sure if a Row Limit cell would have to be required so the spacing doesn't just continue to the end of the sheet which wouldn't be required.
Thanks for reading!
I'd like to be able to create VBA which will insert a row based on a cell reference (for that row number) and will use spacing to insert the same row at say a spacing of 5.
Basically the issue is if a line is added to say a P&L (in this case Overheads), then for n number of companies each of there P&L's need a new line inserted so believe a VBA should be able to make this quicker.
Hopefully the example below is clear, I'm not sure if a Row Limit cell would have to be required so the spacing doesn't just continue to the end of the sheet which wouldn't be required.
Thanks for reading!
Book2 | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | VBA Inputs | ||||||||
2 | Row | Spacing | |||||||
3 | 9 | 5 | |||||||
4 | |||||||||
5 | P&L List | Before | After | ||||||
6 | Revenue | 1 | Company 1 | 1 | Company 1 | ||||
7 | Cost of Sales | 2 | Revenue | 2 | Revenue | ||||
8 | Overheads | 3 | Cost of Sales | 3 | Cost of Sales | ||||
9 | Profit | 4 | Profit | 4 | Overheads | ||||
10 | 5 | 5 | Profit | ||||||
11 | 6 | Company 2 | 6 | ||||||
12 | 7 | Revenue | 7 | Company 2 | |||||
13 | 8 | Cost of Sales | 8 | Revenue | |||||
14 | 9 | Profit | 9 | Cost of Sales | |||||
15 | 10 | Overheads | |||||||
16 | 11 | Profit | |||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E3 | E3 | =C11-C6 |
D7:D8 | D7 | =A6 |
D9 | D9 | =A9 |
D12:D14 | D12 | =D7 |