ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing a range in a formula with VB. (https://www.excelbanter.com/excel-programming/339060-changing-range-formula-vbulletin.html)

jk

Changing a range in a formula with VB.
 
I have created a custom formula that takes two ranges as input (i.e. the call
to the function is "=my_function(range1,range2)"). Using VBA I want to read
in each of these custom formulas located in a matrix, increment range1 by 28
rows, and then put the resulting formula into a new cell. Does anyone know
of a way to do this using VBA? Note that range1 varies for every cell in the
matrix.

Thanks for the help!

Dave Peterson

Changing a range in a formula with VB.
 
Functions in a worksheet cell can only return values to that cell.

They can't change other cells.

jk wrote:

I have created a custom formula that takes two ranges as input (i.e. the call
to the function is "=my_function(range1,range2)"). Using VBA I want to read
in each of these custom formulas located in a matrix, increment range1 by 28
rows, and then put the resulting formula into a new cell. Does anyone know
of a way to do this using VBA? Note that range1 varies for every cell in the
matrix.

Thanks for the help!


--

Dave Peterson


All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com