VBA source code

Hi all.

I need to do my final year project in Excel using VBA.
The project is in such a way that i can generate curves using Excel.
I have been searching for the samples source code for cosine, sine and FFT source code, but to no avail. Could anyne please advise me on this? I am a newbie to VBA, so i'm rather lost now.. Thanks in advance.

[495 byte] By [sulphox] at [2008-2-3]
# 1
in the VBA Help

Dim MyAngle, MySecant
MyAngle = 1.3 ' Define angle in radians.
MySecant = 1 / Cos(MyAngle) ' Calculate secant.

Gnomie at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 2
Hi Gnomie.

First of all, thanks for the advice.
Do you mean that if i add the above source code into the VB editor then i'll be able to calculate secant in excel? how about cosine. i tried to use the formula =COS(pi*A2/180) but the results i obtained is #NAME?. I'm using excel 2003.

sulphox at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 3
The problem is not with the "=COS(", but with the"pi*A2".
Try:
=COS(PI()*A2/180)
Gnomie at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 4
Thanks Gnomie,

It works.. :)) By the way, is it possible to draw the cosine graph based on the formula using excel? It seems like, i can only plot the graph based on the values keyed in the tables. Furthemore the graph obtained using the excel's Chart>XY Scatter doesn't look like cos graph. Do i need to write a program in order to to draw the cosine graph?

sulphox at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 5
Sorry Mate, Graphs are not my area of knowledge...
Gnomie at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...
# 6
No problem.
Thanks alot for your help:))
sulphox at 2007-9-9 > top of Msdn Tech,Microsoft ISV Community Center Forums,Visual Basic for Applications (VBA)...