PDA

View Full Version : VBA Programming in PowerPoint Please Help!



Andyman448
11-14-2008, 12:16 PM
Hi I am working on a Power Point project and I am learning how to program macro to it.
I have created 5 pages in power point on the first page I have placed a button.
When I click the button this code starts:

Dim myArray(4)

Sub YourName()
userName = InputBox(Prompt:="Enter Your Name Here")

myArray(0) = "Page 1"
myArray(1) = "Page 2"
myArray(2) = "Page 3"
myArray(3) = "Page 4"

max = UBound(myArray)

MsgBox myArray(Int((max * Rnd)))

End Sub

Now I want to replace the MsgBox so instead of typing Page "Rnd Nr"
I Want it to move to that page in the power point!!

So if anyone out here can help me I would really appreciate it. :friends:
By the way, Sorry for my english.
Thank you!!!

John Wilson
11-15-2008, 01:23 AM
Maybe some of this will help
See especially - Random slides
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html#vba



Hi I am working on a Power Point project and I am learning how to program macro to it.
I have created 5 pages in power point on the first page I have placed a button.
When I click the button this code starts:

Dim myArray(4)

Sub YourName()
userName = InputBox(Prompt:="Enter Your Name Here")

myArray(0) = "Page 1"
myArray(1) = "Page 2"
myArray(2) = "Page 3"
myArray(3) = "Page 4"

max = UBound(myArray)

MsgBox myArray(Int((max * Rnd)))

End Sub

Now I want to replace the MsgBox so instead of typing Page "Rnd Nr"
I Want it to move to that page in the power point!!

So if anyone out here can help me I would really appreciate it. :friends:
By the way, Sorry for my english.
Thank you!!!