Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie needs help in VBA

Code:

Option Base 1
Function ABN(n, npoint)
Dim Temp(2)
Sum = 0
sum1 = 0
alpha = 2# * 3.141592654 / npoint
For j = 1 To npoint
ang = alpha * (j - 1)
Sum = Sum + Cells(6 + j, 4) * Cos(n * ang)
sum2 = sum2 + Cells(6 + j, 4) * Sin(n * ang)
Next j
Temp(1) = Sum * 2# / npoint
Temp(2) = sum2 * 2# / npoint
If n = 0 Then Temp(1) = Temp(1) / 2
ABN = Temp
End Function

If i want to create a click() function to calculate temp
(1) and temp(2) and place the results in a table.. How do
i go about using a sub function to call a function.

All the user needs to do is to input the value of n and
npoint, and click on the button and the values will be
calculated automatically and placed in a particular
column in the table

Urgent!! pls help. thx
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie lena Excel Worksheet Functions 5 February 6th 09 03:36 PM
Newbie lena Excel Worksheet Functions 2 February 6th 09 06:52 AM
newbie ? Charles Eaves New Users to Excel 1 July 28th 08 09:11 AM
Real Newbie newbie question Dave New Users to Excel 0 January 10th 07 07:55 PM
Can you help a NEWBIE please flub Excel Discussion (Misc queries) 11 January 11th 06 01:58 AM


All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"