excel - Adding a single cell to a Range in a formula -


i have sub dynamically selects range of cells , passes range in internal rate of return formula. need have single cell appended beginning of range formula work. see below:

dim calcrange range set calcrange = range(range("b57"), range("b57").end(xltoright))  range("irr").formula = "=irr(" & calcrange.address & ")" 

so ideally, i'd add named range cell "investmentoutlay" first cell in range. investmentoutlay cell on previous sheet, order i'd formula run through

=irr(investmentoutlay,b57,c57, etc) 

... possible do?

like this, using union join 2 ranges?

set calcrange = union(range("investmentoutlay"), range(range("b57"), range("b57").end(xltoright))) 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

android - Unable to generate FCM token from dynamically instantiated Firebase -