[Solved] Reference problem

  • I'm having a problem with a macro that I'm trying to run. When I run the macro in the spot that I recorded it it works but if I start it from a different cell all of my formulas change. The thing is I would like for parts of the formula to change like the values that I'm pulling off of that page, but I don't want the references to tables I have on seperate pages to to be changed relative to the cell I start in. Is there anything I can do?

  • When you record functions, they are written in R1C1 form. numbers in [] are relative. For example, a formula inserted into cell B2 that is recorded as
    Range("B2").FormulaR1C1="=R[-1]C"
    would refer to cell B1. To change it to an absolute reference to B1, change the formula to
    Range("B2").FormulaR1C1="=R1C2"
    Does this help?

  • Without seeing your formulas, I can't help you much more. The references to your tables need to be absolute (or better, use defined names). The references that need to be relative should stay that way. If you care to post an example workbook, then you will receive more specific help if needed.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!