number,x, from cell A3 and a positive integer, n, from cell B3 then
returns into cell C3 the value of x raised to the power n divided by
n factorial.


where x in cell a3 = 2 and n in cell b3 = 5


im using this formula, but when i run it nothing happens, how do i
make this vba programme run and return the value?


the vba programmes is ok its just no running anything or doing
anything
to my spreadsheet when i need it to return into cell C3

i think i need to delcare the vaiables, but not sure how to doo it.

basically i need help in order for my spreasheet of the numbers x and
n to return in cell a3 the value of x raised tot he power n divided by
n factorial but nothin is happening in the spreadhseet, can any one
tell me or show me how to do this

please i really want to do this, but cant


this is the vba programme:


Public Function MyFunction(X As Double, N As Long) As Variant
If (N <= 0&) _
Then
MyFunction = "N must be an integer greater than zero"
Else
MyFunction = (X ^ N) / WorksheetFunction.Fact(N)
End If
End Function

Re: programme fucntioning problems by Jonathan

Jonathan
Thu Sep 06 08:33:58 CDT 2007

Hi harry

It looks as if your problem is in Excel. This group deals with VBA in Word.
The Excel VBA experts hang out in microsoft.public.excel.programming. You
might want to re-post there.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

"harry" <whitep2@aston.ac.uk> wrote in message
news:1189081504.272166.148550@g4g2000hsf.googlegroups.com...
> number,x, from cell A3 and a positive integer, n, from cell B3 then
> returns into cell C3 the value of x raised to the power n divided by
> n factorial.
>
>
> where x in cell a3 = 2 and n in cell b3 = 5
>
>
> im using this formula, but when i run it nothing happens, how do i
> make this vba programme run and return the value?
>
>
> the vba programmes is ok its just no running anything or doing
> anything
> to my spreadsheet when i need it to return into cell C3
>
> i think i need to delcare the vaiables, but not sure how to doo it.
>
> basically i need help in order for my spreasheet of the numbers x and
> n to return in cell a3 the value of x raised tot he power n divided by
> n factorial but nothin is happening in the spreadhseet, can any one
> tell me or show me how to do this
>
> please i really want to do this, but cant
>
>
> this is the vba programme:
>
>
> Public Function MyFunction(X As Double, N As Long) As Variant
> If (N <= 0&) _
> Then
> MyFunction = "N must be an integer greater than zero"
> Else
> MyFunction = (X ^ N) / WorksheetFunction.Fact(N)
> End If
> End Function
>