Suppose 3 columns and 6 rows of a worksheet are
as follows:
A B C
1 AJAX 1 JAN 2008 -400
2 AJAX 3 FEB 2008 30
3 AJAX 1 DEC 2009 600
4 WIDG 2 FEB 2008 -500
5 WIDG 3 MAR 2009 25
6 WIDG 1 DEC 2009 740
XIRR(C1:C3, B1:B3) returns an internal rate of return for
AJAX
XIRR(C4:C6, B4:B6) returns an internal rate of return for
WIDG
How would one write a VBA subroutine that will do this?
Note: The number of items increases each period, so
I need a routine that loops through all the AJAXs, lists
the IRR in a blank cell, then loops through all the WIDGs
and lists the IRR in a blank cell. When a blank cell
is encountered at the bottom of the list--the subroutine
stops.
Any help appreciated.
Bookmarks