I have refactored my VBA macro by a set of functions,

`Function XRotate(X As Double, Y As Double, ang As Double, LocPinX As Double)`

XRotate = X * Cos(ang) - Y * Sin(ang) + LocPinX

End Function

Function YRotate(X As Double, Y As Double, ang As Double, LocPinY As Double)

YRotate = X * Sin(ang) + Y * Cos(ang) + LocPinY

End Function

Now, Sin and Cos funtions dissapeared in my macro in other parts.