sub or fuction not defined

S

Steven

Can anyone help me?
This line of code bring up the message when run "sub or function not
defined" and highlights the acos in the code.
Cells(i, 2) = Cos([L2] * Acos(Cells(i - 1, 2) / Radical))
I've tried alot- can you help me?
 
K

Ken Johnson

Steven,
Acos is an xl Worksheet function, not a VB math Method and should me
addressed as WorksheetFunction.Acos(Cells(i-1,2)/Radical ).
That might be the problem.
Ken Johnson
 
N

Norman Jones

Hi Steven,

ACOS is an Excel worksheet function, so try changing Acos to
Application.ACOS
 
D

Dave Peterson

VBA's help also shows this as a derived math function:

Inverse Cosine
Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)
Can anyone help me?
This line of code bring up the message when run "sub or function not
defined" and highlights the acos in the code.
Cells(i, 2) = Cos([L2] * Acos(Cells(i - 1, 2) / Radical))
I've tried alot- can you help me?
 

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