Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use the following code to change my formula from:
=SUM(OFFSET(C50,-6,78,-12,1))/SUM(OFFSET(C50,-6,-1,-12,1)) to =SUM(OFFSET(C50,-7,80,-12,1))/SUM(OFFSET(C50,-7,-3,-12,1)) Sub AdjustNew12Formulas() U = 6 R = 78 L = 1 For x = 1 To 28 ActiveCell.FormulaR1C1 = _ "=SUM(OFFSET(RC,-" & U & "," & R & ",-12,1))/SUM(OFFSET(RC,-" & U & ",-" & L & ",-12,1))" ActiveCell.Offset(0, 2).Range("A1").Select U = U + 1 R = R - 1 L = L + 2 Next x What I need at this point is a way to determine what my variables are to begin with. In other words, if the first part of the formula is SUM(OFFSET(C50,-6,78,-12,1)) I want it to set the starting point for U at 6, starting point for R as 78, etc... |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula to add depending upon value entered | Excel Worksheet Functions | |||
Same formula, different results depending on machine? | Excel Worksheet Functions | |||
Formula Depending On Formatting | Excel Discussion (Misc queries) | |||
Formula to look for value in a row depending on unknown value? | Excel Worksheet Functions | |||
Value or formula in cell depending on input... | Excel Programming |