JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
For a bit of fun, I have a list of quotes which when my main macro is run, automatically selects and displays one. Simplified code I'm using is:
But everytime I first run this macro after first opening the workbook, i is always generated with the same value - does anyone know why this is and how to make it not do this? I have other code that bounds i between a minimum and maximum value but as said, above is very reduced as this is where in my code the problem is occuring.
Thanks,
Jack
For a bit of fun, I have a list of quotes which when my main macro is run, automatically selects and displays one. Simplified code I'm using is:
Code:
Sub Randomi ()
Dim i as integer
i = (i * Rnd() + 1)
MsgBox i
End Sub
But everytime I first run this macro after first opening the workbook, i is always generated with the same value - does anyone know why this is and how to make it not do this? I have other code that bounds i between a minimum and maximum value but as said, above is very reduced as this is where in my code the problem is occuring.
Thanks,
Jack