-
Special name selector / slot machine
In powerpoint I would like to implement the following macro that shows a random name every 500 ms. It has to continu showing all these random names untill I click the spacebar.
There is a small and sneaky catch to it: if I don't press the spacebar, but for example the letter 'Z' it should show a 'selected' name (the first of second name on the list). When I press the spacebar, I do want to show a random name.
I'm able to write a script like:
Sub generator(oShape As Shape)
Dim name(1 To 50) As String
Dim random As Long
Dim max As Long
name(1) = "Danny"
name(2) = "Roger"
name(3) = "Walther"
name(4) = "Susan"
name(5) = "Jan"
max = 5
Randomize
random = Int((max * Rnd) + 1)
oShape.TextFrame.TextRange.Text = name(random)
End Sub
but I haven't figured out how to change the names continuously and how to stop the loop by using a selected button on my keyboard.
Any ideas?
thnx in advance
Per
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules