Results 1 to 3 of 3

Factorial Function

Threaded View

  1. #1
    Registered User
    Join Date
    05-26-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    10

    Factorial Function

    Hello,

    I am creating a factorial function in VBA Excel for a calculator button. I am not allowed to use built in functions. The code that I am currently using is as follows:
    If Range("B2") = "!" Then
        Number_1 = Range("D3")
            For Count = 1 To Number_1
            Number_2 = Number_2 + 1
            Number_3 = Number_2 * (Number_2 + 1)
            Next Count
        Sheet1.Range("B3") = Number_3
    End If
    I am not quite sure why it will not work. I am very new to VBA. Please reply as soon as possible if you have any solutions to my problem.

    Thank you so much in advance!

    ~ Microsoft Excel ~
    Last edited by Leith Ross; 06-15-2013 at 01:37 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1