Stop Re-calculating Randbetween

F

FredB

I am developing some simple math questions for my son, and use Randbetween to
generate lists of number for him to do calculations upon. However if he
enters his answers into the spreadsheet, excel re-calculates and changes the
random number values in the math problem. I want to be able to keep the
random numbers, allow my son to enter his answers, use a formula to check
which answers are correct, and not change any of the random numbers until the
next time the I call the macro. Any help would be much appreciated.
 
M

Mike H

Hi,

Generate your random numbers with a macro instead. Right click the sheet
tab, view code and paste this in:-

Sub sonic()
For x = 1 To 100
mynum = Int((100 - 1 + 1) * Rnd + 1)
Cells(x, 1).Value = mynum
Next
End Sub

This puts 100 random numbers between (1 & 100) in column A some will be
duplicated but they would with randbetween also.

Mike
 
F

FredB

Thanks Mike H

It works a treat

Mike H said:
Hi,

Generate your random numbers with a macro instead. Right click the sheet
tab, view code and paste this in:-

Sub sonic()
For x = 1 To 100
mynum = Int((100 - 1 + 1) * Rnd + 1)
Cells(x, 1).Value = mynum
Next
End Sub

This puts 100 random numbers between (1 & 100) in column A some will be
duplicated but they would with randbetween also.

Mike
 

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

Top