I'm running into an interesting problem.
I am writing a macro to copy data from one workbook to another. All of the information to be copied is compiled into one main worksheet in my first workbook. There are columns that have an Offset formula which reference another cell on the worksheet for the "column" offset value. I can't have these as absolute formulas because the columns are dynamically created (there could be 1 column or 5 or 10 or whatever). Down the column some of the cells have this offset formula and some have formulas that reference cells above in the column, so I can't make those absolute or they'll get messed up when I copy into the new workbook.
Right now, the Offset formulas are getting messed up because the column offset value which is referencing a cell on the worksheet gets shifted when I copy into the new workbook. Sometimes so far left that it now no longer is a valid cell and I get a #REF error.
I know if I make them absolute references, they will copy correctly, but then when I am dynamically creating the number of columns in the first workbook it won't work when I fillRight on the formulas. And I can't just blanket make all formulas absolute after I create the number of columns I need because some of the formulas can't be absolute references.
Does anyone have a good solution for this?
I am writing a macro to copy data from one workbook to another. All of the information to be copied is compiled into one main worksheet in my first workbook. There are columns that have an Offset formula which reference another cell on the worksheet for the "column" offset value. I can't have these as absolute formulas because the columns are dynamically created (there could be 1 column or 5 or 10 or whatever). Down the column some of the cells have this offset formula and some have formulas that reference cells above in the column, so I can't make those absolute or they'll get messed up when I copy into the new workbook.
Right now, the Offset formulas are getting messed up because the column offset value which is referencing a cell on the worksheet gets shifted when I copy into the new workbook. Sometimes so far left that it now no longer is a valid cell and I get a #REF error.
I know if I make them absolute references, they will copy correctly, but then when I am dynamically creating the number of columns in the first workbook it won't work when I fillRight on the formulas. And I can't just blanket make all formulas absolute after I create the number of columns I need because some of the formulas can't be absolute references.
Does anyone have a good solution for this?