L'erreur, c'est sans doute parce que tu as l'option explicit par défaut... donc on déclare également la variable a, dans ce cas là :
Sub try()
Application.ScreenUpdating = False
Dim derLig As Long, a As Long
Dim derCol As Integer
With Sheets("Historique synthèse")
derLig = .Range("A" & Rows.Count).End(xlUp).Row
For a = 5 To derLig
derCol = .Cells(a, Columns.Count).End(xlToLeft).Column
If Not IsEmpty(.Cells(a, derCol)) Then .Cells(a, "C") = .Cells(a, derCol) - .Cells(a, derCol - 1)
Next a
End With
End Sub
Application.ScreenUpdating = True n'est pas nécessaire car cette commande redevient automatiquement vraie à la find de ton programme.