I need to make a function that finds Cosine in Degrees. I am on Mac-OS Excel 2011
Function cosd(d)
deg = (d * 3.14159265358979) / 180
cosd = WorksheetFunction.Cos(deg)
End Function
It still does not work.
You are really close the only trouble with your function (well, besides that not declaring your variables is bad practice) is that Cos
isn't a VBA function. Change your function to
Function cosd(d As Double) As Double
cosd = Application.WorksheetFunction.Cos((d * Application.WorksheetFunction.Pi) / 180#)
End Function
and it should work just fine.