Hello,
I'm trying to get a macro to run whenever new data is entered in a cell. I want this to work for every cell in a row.

When active the macro updates various cells on the same row with data (in this case formulas.

The bit I'm having trouble with is getting the macro to work when the cell is updated.

I've been looking through various forums to no avail.

Thanks in advance for any help.

Paul

Private Sub Worksheet_Calculate(ByVal Target As Range)

' Turns off Screen Update
Application.ScreenUpdating = False

If Not Intersect(Target, Range("K:K")) Is Nothing Then

' Imputs forulas to a number of cells on the same row as the target cell
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC[-1],Material,1,0))=FALSE,VLOOKUP(RC[-1],MaterialTypeID,2,0),"""")"
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1 = "=IF(ISNA(VLOOKUP(RC[-2],Material,1,0)) = TRUE, ""N"","""")"
ActiveCell.Offset(0, 8).Select
ActiveCell.FormulaR1C1 = "=IF(RC[-8]=""N"",RC[-9],"""")"
ActiveCell.Offset(0, 14).Select
ActiveCell.FormulaR1C1 = "=IF(RC[-1]>1,""Yes"","""")"
ActiveCell.Offset(0, -23).Select
End If

' Turns on Screen Update
Application.ScreenUpdating = True

End Sub