The 1st and last Cells references were not qualified with Sheets(tab1)
If Sheets(tab1).Cells(i, 6) = Sheets("Machining").Range("j10") And Sheets(tab1).Cells(i, 12) = "As wound" Then Sheets(tab1).Cells(i + 1, 16) = (Sheets(tab1).Cells(i, 16) * (Sheets(tab1).Cells(i + 1, 14) - Sheets(tab1).Cells(i + 1, 18))) / (Sheets(tab1).Cells(i, 14) - Sheets(tab1).Cells(i, 18))
Or you could use something like this...
With Sheets(tab1)
If .Cells(i, 6) = Sheets("Machining").Range("j10") And .Cells(i, 12) = "As wound" Then .Cells(i + 1, 16) = (.Cells(i, 16) * (.Cells(i + 1, 14) - .Cells(i + 1, 18))) / (.Cells(i, 14) - .Cells(i, 18))
End With
Bookmarks