A
aksel børve
I am trying to make a loop that calculate each cell to the right of the
"RngMdDp1"-range, based on the value in cell "I3" and "RngMdDp1" . The cells
in "RngMdDp1" gets higher values for each cells, so at one cell there sould
be a breaking point, and the formula would be changed.
can anyone se whats wrong with the macro?
Sub DrillPipe1()
For Each c In Range("RngMdDp1")
If c.Value < ("I3") Then c.Offset(0, 1).FormulaR1C1 =
"=(RC[-1]*RC[-2])" Else c.Offset(0, 1).FormulaR1C1 = "=(RC[-1])"
Next c
End Sub
"RngMdDp1"-range, based on the value in cell "I3" and "RngMdDp1" . The cells
in "RngMdDp1" gets higher values for each cells, so at one cell there sould
be a breaking point, and the formula would be changed.
can anyone se whats wrong with the macro?
Sub DrillPipe1()
For Each c In Range("RngMdDp1")
If c.Value < ("I3") Then c.Offset(0, 1).FormulaR1C1 =
"=(RC[-1]*RC[-2])" Else c.Offset(0, 1).FormulaR1C1 = "=(RC[-1])"
Next c
End Sub