continous assessment help with vba

P

paul

Hi im required to write an asessment for vba, and was wondering if
someone could give me an example of how to do it, i really want to
learn how to do it because it will come up in my exam. so if someone
could show me an example of how to do it i would be grateful.

write a programme that takes a number X from cell A3 and a positive
integer from cell B3 - then return it into cell C3.

the value of X raised to the power N divided by N factorial

could anyone help me as to how to approach this and what it means??

thanks please
 
G

Guest

Just so we're all clear here...

Are these problems you present actual exam questions or sample problems? I
wouldn't want to facilitate cheating, after all...

In any case, these aren't too bad. Regarding the first problem, what do you
want to do with the two values obtained from A3 and B3? Multiply? Also, the
second problem can be solved with the following formula:

=(X ^ N) / FACT(N)

or the following VBA function:

Function test(x As Range, N As Range) As Double
test = (x ^ N) / Application.WorksheetFunction.Fact(N)
End Function

Functions are special VBA programs that can be called from a cell within
Excel. That is, put this function in a module in a workbook, and then you
can type
=test(2,5)
in a cell to obtain the result of 0.2667. Search the VBA help files for
"Function" for more information on this.

HTH,
Pflugs
 

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

Similar Threads

vba 2
running varibiables into vba 1
programme run help 2
programme fucntioning problems errors 2
running a programme 9
writing in vba 13
vba coding 3
PROGRAMME HELP 2

Top