(Solved) – VBA Loop Until Two Numbers Don’t Match


I’m trying to set a textbox.value to a random number and loop until it gets to a number not equal to another textbox value. I’m getting an infinite loop though. I’m probably missing something pretty fundamental here…

me.Text1.Value = 1
me.Text2.Value = 5
rndPlace = Int((5 - 1   1) * Rnd   1)


me.Text1.Value = rndPlace

Loop Until me.Text1.Value <> me.Text2.Value

Leave a Reply

Your email address will not be published. Required fields are marked *