Hi all,
I have extracted a few tables from a large set of data into a new workbook with VBA. Next, I wrote a macro to copy/paste these tables into new sheets on the workbook. I know how to copy/paste ranges with macros but now I would want to figure out a way to calculate CAGR in a new column for all rows in the tables while they are pasted to new sheets. I have tried googling this for a few hours with no luck, maybe some of you experts would be able to help me.
The table below illustrates my problem. Everything else is already done but I'd like the CAGR column to be calculated when the tables are pasted to respective sheets with VBA.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Revenues
[/TD]
[TD]2010
[/TD]
[TD]2011
[/TD]
[TD]2012
[/TD]
[TD]2013
[/TD]
[TD]2014
[/TD]
[TD]2015
[/TD]
[TD]CAGR 2010-2015
[/TD]
[/TR]
[TR]
[TD]Company A
[/TD]
[TD]100
[/TD]
[TD]110
[/TD]
[TD]120
[/TD]
[TD]130
[/TD]
[TD]140
[/TD]
[TD]150
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company B
[/TD]
[TD]110
[/TD]
[TD]123
[/TD]
[TD]154
[/TD]
[TD]134
[/TD]
[TD]155
[/TD]
[TD]178
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company C
[/TD]
[TD]200
[/TD]
[TD]300
[/TD]
[TD]400
[/TD]
[TD]500
[/TD]
[TD]600
[/TD]
[TD]700
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company D
[/TD]
[TD]220
[/TD]
[TD]320
[/TD]
[TD]450
[/TD]
[TD]420
[/TD]
[TD]555
[/TD]
[TD]666
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company E
[/TD]
[TD]10
[/TD]
[TD]15
[/TD]
[TD]35
[/TD]
[TD]85
[/TD]
[TD]45
[/TD]
[TD]99
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance,
reck1ns
I have extracted a few tables from a large set of data into a new workbook with VBA. Next, I wrote a macro to copy/paste these tables into new sheets on the workbook. I know how to copy/paste ranges with macros but now I would want to figure out a way to calculate CAGR in a new column for all rows in the tables while they are pasted to new sheets. I have tried googling this for a few hours with no luck, maybe some of you experts would be able to help me.
The table below illustrates my problem. Everything else is already done but I'd like the CAGR column to be calculated when the tables are pasted to respective sheets with VBA.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Revenues
[/TD]
[TD]2010
[/TD]
[TD]2011
[/TD]
[TD]2012
[/TD]
[TD]2013
[/TD]
[TD]2014
[/TD]
[TD]2015
[/TD]
[TD]CAGR 2010-2015
[/TD]
[/TR]
[TR]
[TD]Company A
[/TD]
[TD]100
[/TD]
[TD]110
[/TD]
[TD]120
[/TD]
[TD]130
[/TD]
[TD]140
[/TD]
[TD]150
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company B
[/TD]
[TD]110
[/TD]
[TD]123
[/TD]
[TD]154
[/TD]
[TD]134
[/TD]
[TD]155
[/TD]
[TD]178
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company C
[/TD]
[TD]200
[/TD]
[TD]300
[/TD]
[TD]400
[/TD]
[TD]500
[/TD]
[TD]600
[/TD]
[TD]700
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company D
[/TD]
[TD]220
[/TD]
[TD]320
[/TD]
[TD]450
[/TD]
[TD]420
[/TD]
[TD]555
[/TD]
[TD]666
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Company E
[/TD]
[TD]10
[/TD]
[TD]15
[/TD]
[TD]35
[/TD]
[TD]85
[/TD]
[TD]45
[/TD]
[TD]99
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thanks in advance,
reck1ns