rpaulson
Well-known Member
- Joined
- Oct 4, 2007
- Messages
- 1,286
Hello all,
I have a macro that selects a random number and writes it to a cell.
Anyone know how to get it to stop when the user presses the space bar?
Tia,
Ross
I have a macro that selects a random number and writes it to a cell.
Code:
Sub do_it()
Do
'when space bar is pressed then exit sub
Range("A1") = Int((10 - 1 + 1) * Rnd + 1) 'random number between 1 and 10
Loop
End Sub
Anyone know how to get it to stop when the user presses the space bar?
Tia,
Ross