Add Cell OFFSET Formula Via Macro Code

  • I have a macro that inserts a new column and enters a formula in to a cell. Here is the formula part.


    Code
    Range("energy").FormulaR1C1 = "=((tms-R9C7)/R9C7)*100"


    How can I have the formula subtract "tms" from Range("tms").offset(0,1) then / by Range("tms").offset(0,1).


    In other words I want the formula to remain the same but instead of R9C7, I need it to be 1 col over from "tms" so the formual will always calculate right if new lines get entered. Note: I can't name the cell because that is where the new col gets inserted


    thank you.

Participate now!

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