I am using a VBA code to get sums but it does not work when cells are locked.
I want that no one can change the value of the specific cell manually but the VBA code can
maybe you can do it this way:
Sub Get_Sum()
Dim LastRow As Long
Sheets("Sheetname").Unprotect Password:= "password"
LastRow = Range("B5000").End(xlUp).Row
Range("D" & LastRow + 1) = "Total Amount"
Range("E" & LastRow + 1).Formula = "=SUM(E4:E" & LastRow & ")"
Range("F" & LastRow + 1).Formula = "=SUM(F4:F" & LastRow & ")"
Range("G" & LastRow + 1).Formula = "=SUM(G4:G" & LastRow & ")"
Sheets("Sheetname").Protect Password:= "password"
End Sub