Post the code of 'Correct'

Sub Correct()

Dim Correct() As Excel.Application

Dim cr As Range

Dim Pi As Long

' Dim MySqrt as Double = Math.Sqrt()

' Pi = 3.14159265358979

For Each cr In Range("D16")

If UCase(cr) + Range("D17") <= 360 Then

Range("D18").Formula = "=(D16+d17)"

Range("D19").Formula = "=D18-(D17*2)"

ElseIf UCase(cr) + Range("D17") > 360 Then

Range("D18").Formula = "=(D16+D17)-360"

Range("D19").Formula = "=D18-(D17*2)"

End If

Next cr

For Each cr In Range("D19")

If UCase(cr) < 1 Then

Range("D19").Formula = "=(D18-(D17*2))+360"

ElseIf UCase(cr) + 0 > 360 Then

Range("D19").Formula = "=(D18-(D17*2))-360"

End If

Next cr

' tested to here

For Each cr In Range("D27")

If Range("D27") > 360 Then

Range("D27").Formula = "=D27-360"

ElseIf Range("D27") < 1 Then

Range("D27").Formula = "=D27+360"

End If

Range("D28").Formula = "=(D27+D24)"

If Range("D28") > 360 Then

Range("D28").Formula = "=D27+D24-360"

ElseIf Range("D28") < 1 Then

Range("D28").Formula = "=D27-D24+360"

End If

Range("D29").Formula = "=(Cos(D24 * Pi() / 180)) * D25"

Range("D30").Formula = "=(D26 - D29)"

Range("D31").Formula = "=Sqrt((D25 * D25) - (D29 * D29))"

Range("D32").Formula = "=D27 - ((Atan(D31 / D30) * 180 / Pi()))"

Next cr

For Each cr In Range("D32")

If UCase(cr) < 1 Then

' Range("D32") = "= D32 + 360"

Range("D32").Formula = "=(D27-((Atan(D31/D30)*180/Pi)))+360"

ElseIf UCase(cr) > 360 Then

Range("D32").Formula = "=(D27-((Atan(D31/D30)*180/Pi))-360)"

End If

Next cr

End Sub