PC Review


Reply
Thread Tools Rate Thread

Convert Radian to degree angle for COS function

 
 
catherine
Guest
Posts: n/a
 
      17th Nov 2009
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
 
Reply With Quote
 
 
 
 
Sam Wilson
Guest
Posts: n/a
 
      17th Nov 2009
MsgBox Cos(ActiveCell.Value * 180 / WorksheetFunction.Pi())


Sam

"catherine" wrote:

> 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

 
Reply With Quote
 
Sam Wilson
Guest
Posts: n/a
 
      17th Nov 2009

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()]

"Sam Wilson" wrote:

> MsgBox Cos(ActiveCell.Value * 180 / WorksheetFunction.Pi())
>
>
> Sam
>
> "catherine" wrote:
>
> > 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

 
Reply With Quote
 
Sam Wilson
Guest
Posts: n/a
 
      17th Nov 2009

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()


"Sam Wilson" wrote:

> MsgBox Cos(ActiveCell.Value * 180 / WorksheetFunction.Pi())
>
>
> Sam
>
> "catherine" wrote:
>
> > 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

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      17th Nov 2009
"Sam Wilson" wrote 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



 
Reply With Quote
 
Sam Wilson
Guest
Posts: n/a
 
      17th Nov 2009
I felt it was important to share the maths behind it, and to stage the answer
in three parts.


"Peter T" wrote:

> "Sam Wilson" wrote 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
>
>
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how make an angle to show in degree, minute,second instead of degree EXCEL NEWS Microsoft Excel Programming 4 28th Apr 2008 07:02 AM
degree or angle =?Utf-8?B?ZWtrZWluZG9oYQ==?= Microsoft Excel Worksheet Functions 3 29th Jan 2007 01:54 PM
Imputting an angle degree. Degree, minute, second =?Utf-8?B?R3JhaGFt?= Microsoft Excel Misc 6 19th Oct 2006 03:07 PM
Imputting an angle degree. Degree, minute, second =?Utf-8?B?R3JhaGFt?= Microsoft Excel Worksheet Functions 1 13th Oct 2006 07:58 PM
desktop at a 90 degree angle D Microsoft Powerpoint 1 8th Nov 2004 06:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:16 AM.