Hey all,
I'm try to make my userform generate 6 random number that all meet a minimum value. I'd like to do this without cell references, so entirely within the VBA code. I've tinkered around and can't seem to make it work. Some tries did nothing, some ignored the minimum. Here's an example of the code I'm using.
I'm afraid there's circular logic stuff that might be preventing it from working, but not sure how to remedy. There will be six text boxes in total, so unless there's a way to make it look at each one in turn, I'll just end up running this six times in a row referencing different textboxes. If anyone can shed some light I'd be very greatful.
I'm try to make my userform generate 6 random number that all meet a minimum value. I'd like to do this without cell references, so entirely within the VBA code. I've tinkered around and can't seem to make it work. Some tries did nothing, some ignored the minimum. Here's an example of the code I'm using.
Code:
Do While TextBox1.Value < MinimumNumberTextBox.Value
Randomize
MyNumber = Int((20 - 1 + 1) * Rnd + 1)
TextBox1.Value = MyNumber
Loop