I need a source code for prime number calculator VBA.

Asked By 90 points N/A Posted on -
qa-featured

Hi Coders!

I have been trying to create some functions in VBA to carry out some particular tasks. At the moment, I would like to develop a prime number calculator VBA for easy pupils' online learning. Is there anyone with a source code for a prime number calculator that I can use for this particular assignment? Thanks big time for your generosity.

SHARE
Best Answer by Reginald E Cosentino
Best Answer
Best Answer
Answered By 40 points N/A #154475

I need a source code for prime number calculator VBA.

qa-featured

Hi,

Different website provides source code for prime number calculator. However, the required code is available  or Click here . Just use this code and then run it in the JavaScript and finally you will find things are working fine. Moreover, it's very simple and easy as well.

Answered By 0 points N/A #154476

I need a source code for prime number calculator VBA.

qa-featured

In Excel, you can use the following code for determining prime numbers:

Dim divisors As Integer, number As Long, i As Long

divisors = 0

number = InputBox("Enter a number")

For i = 1 To number

If number Mod i = 0 Then

                divisors = divisors + 1

End If

Next i

If divisors = 2 Then

       MsgBox number & " is a prime number"

Else

      MsgBox number & " is not a prime number"

End If

Login/Register to Answer

Related Questions