I've created a calculator in excel using some basic formulas. The calculator depends on several inputs. I've created a list of different combinations of inputs and I want to make a macro that will update the appropriate cells in the calculator, copy the result, and paste the value next to the combination of inputs. The thing is I only know how to record a macro, the code below does what I want for one row of inputs:
Sub Test()
'
' Test Macro
'
' Keyboard Shortcut: Ctrl+t
'
Range("E25").Select
ActiveCell.FormulaR1C1 = "=R[-19]C[82]"
Range("E27").Select
ActiveCell.FormulaR1C1 = "=R[-21]C[83]"
Range("E33").Select
ActiveCell.FormulaR1C1 = "=R[-27]C[84]"
Range("E34").Select
ActiveCell.FormulaR1C1 = "=R[-28]C[85]"
Range("Q30").Select
Selection.Copy
Range("CM6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Selection.NumberFormat = "$#,##0.00"
End Sub
How do I edit it to do this for the first row then go to the second and do the same thing only the "ActiveCell.FormulaR1C1 " should be based on the inputs in the new row? Does that question make sense, seems like it should be easy for someone with the know how. Thanks!
Bookmarks