I've created a user form to enter some values in a few adjacent cells. When the user clicks on a button, I want several other cells to be loaded with special formulas that refer to the new values. This happens on a row by row basis. First, a working formula in that cell which is AB5 is:
=IFERROR((IF(AK5<0.2,((((AK5*100)-2)/10)*(AJ5/60)),(((AK5*100)-2)/7)*(AJ5/60))),0)
Now, here's my code for the that first cell:
Private Sub btnSave_Click()
TheRow = ActiveCell.Row
TheCol = ActiveCell.Column
Cells(TheRow, 28).Select ' I want to work with Column AB for whatever row is the active row
Selection.FormulaR1C1 = "=IFERROR((IF(RC[9]<0.2,((((RC[9]*100)-2)/10)*(RC[8]/60)),(((RC[9]*100-2)/7)*(RC[8]/60))),0)"
End Sub
I'll have a few other formulas to store into other nearby cells, but if I know how to do this one, I'll be able to figure out how to do the others. TIA, Leon
Bookmarks