How to make NON RANDOM this EXCEL VBA -
helo guys. me resolve excel vba code. i'm having trouble on how make flashcard appear in order cell a1 down last cell. have code generates random cell or value. how can make non random? know using code rnd, generates randomly. how non random?
here's code:
private sub nextcard() application.screenupdating = false dim finaltermrow integer finaltermrow = range("a60000").end(xlup).row dim possiblerow integer dim foundterm boolean foundterm = false dim tries integer tries = 0 while foundterm = false , tries < 1000 possiblerow = rnd() * (finaltermrow - 2) + 2 if cells(possiblerow, 4).value = "" if possiblerow <> previousrow foundterm = true end if end if tries = tries + 2 loop application.screenupdating = true if tries < 1000 currentrow = possiblerow boxquestion.text = cells(currentrow, 1).value boxdefinition.text = "" altbox.text = "" else msgbox ("there no other cards go to--you've learned else! congratulations! study cards again, click reset.") end if end sub hope me guys resolve issue. thank you.
replace:
tries = 0 while foundterm = false , tries < 1000 possiblerow = rnd() * (finaltermrow - 2) + 2 with
tries = 0 possiblerow=0 while foundterm = false , tries < 1000 possiblerow = possiblerow + 1
Comments
Post a Comment