I have modify the following code to have a value in Column K:
'This function will add the formula: =IF($I5="","",$I5+40) to the active row on column K
If Not Intersect(Target, Range("I5:I20")) Is Nothing Then
Application.EnableEvents = False
For Each rcell In Intersect(Target, Range("I5:I20")).Cells
If Len(rcell.Value) > 0 Then
Cells(ActiveCell.row, "K").FormulaR1C1 = "=IF(RC9="""","""",RC9+40)"
Cells(ActiveCell.row, "J").Value = Cells(ActiveCell.row, "K").Value
Cells(ActiveCell.row, "K").Value = Cells(ActiveCell.row, "J").Value
Else
'If nothing is in the active cell I, then it will remove anything that is in the Active Row, Column K and J
Cells(Target.row, "K").ClearContents
Cells(Target.row, "J").ClearContents
End If
Next rcell
Application.EnableEvents = True
End If
Bookmarks