Replacing DirectPrecedents in a Formula

  • Thread starter Thread starter Gappodi
  • Start date Start date
G

Gappodi

Hello,

I need to copy a formula to a different sheet where the
DirectPrecedents positions are different. I can get the
DirectPrecedents from the source using the DirectPrecedents property.
I have the corresponding mapping of these DirectPrecedents in the
target.

Is there a way using the Excel Model to replace these DirectPrecedents
using the mapping I have or I have to parse the source and modify the
target accordingly.

Thanks and Regds
Gap
 
Gap,

I'm not sure exactly what your question is. DirectPrecendents is a
read-only property, and any change in the would need to be done by changing
the cell references used in the formula. Depending on your specific
situation, you *might* be able to use the INDIRECT function to accomplish
what you want, but without more information, it is impossible to say.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Chip,

If my formula is "=SUM(A1:A5)" I need to replace this with say
"=SUM(A11:A15)". I have the mapping available with me in this case A1 ->
A11 and A5 -> A15.

I was looking for nice way of doing this without having to parse the
formula and replace the references based on the mapping.

Thanks for your reply

Regds
Gap.
 
Back
Top