random integer problem.

  • Thread starter Thread starter mark_varney47
  • Start date Start date
M

mark_varney47

Hi,
I am trying to generate a random integer between say 0 and 4 in
particular cell(1,5).Then I am trying to say(in cell 1,6) with an I
argument,if this value(in cell 1,5) is greater than value in anothe
cell(2,5) make the value of cell (1,6)=3.I keep getting weird result
that don't make sense.Any help please would be appreciated.
Many Thanks,
Mark:
 
using VBA I use the following function

Public Function RandomNumber(ByVal minX As Integer, ByVal maxX As
Integer) As Integer

Randomize
RandomNumber = Int((maxX - minX) * Rnd()) + minX

End Function
 

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


Back
Top