Convert Radian to degree angle for COS function

C

catherine

Hi,

Do you know how I can ask to Excel with a VBA code to find the Cosinus of
the active cell value when the cell value is in Degree?

Thanks
Catherine
 
S

Sam Wilson

You can ignore the msgbox bit, I just put it there when I tested the code!

All you need is multiply by 180, divide by pi [worksheetfunction.pi()]
 
S

Sam Wilson

Your title says convert radians to degrees, but your post says degreed to
radians!

Degrees --> Radians:
activecell.value * worksheetfunction.pi() / 180

Radians --> Degrees:
activecell.value * 180 /worksheetfunction.pi()
 
P

Peter T

in message
Your title says convert radians to degrees, but your post says degreed to
radians!

:)

Presumably the OP wants to convert degrees to radians for use in Excel's
trig functions

Note Excel also has worksheet functions Radians(deg) and Degrees(rad)

Regards,
Peter T
 
S

Sam Wilson

I felt it was important to share the maths behind it, and to stage the answer
in three parts.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top