PC Review


Reply
Thread Tools Rate Thread

Acos in WorksheetFunction

 
 
Philosophaie
Guest
Posts: n/a
 
      20th Nov 2009
Program:

Pi=Application.WorksheetFunction.Pi
If z/m=Pi/2 or z/m=3*P/2 Then
Msgbox("N/A")
Else
n = Function.WorksheetFunction.Acos(z/m)
End If

Error code:

Run-time Error '1004':
Unable to get the Acos property of the WorksheetFunction.
 
Reply With Quote
 
 
 
 
Dana DeLouis
Guest
Posts: n/a
 
      20th Nov 2009
Hi.

n = WorksheetFunction.Acos(z/m)

> If z/m=Pi/2 or z/m=3*P/2 Then
> Msgbox("N/A")
> Else... whatever...


Note that for a Real solution, z/m should be in the Range -1 to +1.
So numbers near Pi/2 and 3 Pi/2 would return complex numbers.
= = = = = = =
Dana DeLouis



On 11/19/09 8:45 PM, Philosophaie wrote:
> Pi=Application.WorksheetFunction.Pi
> If z/m=Pi/2 or z/m=3*P/2 Then
> Msgbox("N/A")
> Else
> n = Function.WorksheetFunction.Acos(z/m)
> End If
>

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      20th Nov 2009
Try it without the "Function." part...

n = WorksheetFunction.Acos(z/m)

You also do not need to specify the Application object in your first line...

Pi = WorksheetFunction.Pi

--
Rick (MVP - Excel)


"Philosophaie" <(E-Mail Removed)> wrote in message
news:044C7A9D-1586-497E-96D7-(E-Mail Removed)...
> Program:
>
> Pi=Application.WorksheetFunction.Pi
> If z/m=Pi/2 or z/m=3*P/2 Then
> Msgbox("N/A")
> Else
> n = Function.WorksheetFunction.Acos(z/m)
> End If
>
> Error code:
>
> Run-time Error '1004':
> Unable to get the Acos property of the WorksheetFunction.


 
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
Problems with WorksheetFunction.Index and WorksheetFunction.Match Luke Microsoft Excel Programming 4 14th Oct 2009 12:57 AM
Acos function Philosophaie Microsoft Excel Programming 3 22nd Aug 2009 08:40 PM
WorkSheetFunction.CountIf & WorkSheetFunction.SumIf with 2 conditions? Etien Microsoft Excel Programming 3 13th Jan 2004 04:07 PM
WorksheetFunction.CountIf and WorksheetFunction.SumIf with 2 conditions? Etien Microsoft Excel Worksheet Functions 4 12th Jan 2004 06:59 PM
ACOS(1) & ACOS(-1) Error Me Microsoft Excel Misc 4 7th Aug 2003 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:31 PM.