Macro in Powerpoint

C

Cedric

I have a macro in Microsoft Excel listed below. I need to have it put in a
powerpoint presentation. How can I do it? I need for each questions to be
on a different slide and for it to repeat until xxx is entered. Any help
will be appreciated.



Sub OptionExplicit()
'
' OptionExplicit Macro
' Macro recorded 3/10/2008 by Student Financial Aid
'
Dim vName As String
Dim vAddress As String
Dim vCityStateZip As String
Dim vPhoneNumber As String
Dim vEmailAddress As String
Dim vRealEstateAgentAndCompany As String
Dim vxxx As String

vName = InputBox("Please type in your name?")
If vName = "xxx" Then
Exit Sub
Else
vAddress = InputBox("Please enter your address?")
vCityStateZip = InputBox("Please enter City, State and Zip?")
vPhoneNumber = InputBox("Please enter your Phone Number?")
vEmailAddress = InputBox("Please enter your Email Address?")
vRealEstateAgentAndCompany = InputBox("Please enter your Real Estate Agent
and Company?")
Worksheets("Sheet1").Range("B1") = vName
Worksheets("Sheet1").Range("B2") = vAddress
Worksheets("Sheet1").Range("B3") = vCityStateZip
Worksheets("Sheet1").Range("B4") = vPhoneNumber
Worksheets("Sheet1").Range("B5") = vEmailAddress
Worksheets("Sheet1").Range("B6") = vRealEstateAgentAndCompany

'
Range("B1").Select
Range("B2").Select
Range("B3").Select
Range("B4").Select
Range("B5").Select
Range("B6").Select


vName = InputBox("Please type in your name?")
vAddress = InputBox("Please enter your address?")
vCityStateZip = InputBox("Please enter City, State and Zip?")
vPhoneNumber = InputBox("Please enter your Phone Number?")
vEmailAddress = InputBox("Please enter your Email Address?")
vRealEstateAgentAndCompany = InputBox("Please enter your Real Estate Agent
and Company?")
Worksheets("Sheet1").Range("B11") = vName
Worksheets("Sheet1").Range("B12") = vAddress
Worksheets("Sheet1").Range("B13") = vCityStateZip
Worksheets("Sheet1").Range("B14") = vPhoneNumber
Worksheets("Sheet1").Range("B15") = vEmailAddress
Worksheets("Sheet1").Range("B16") = vRealEstateAgentAndCompany

'
Range("B11").Select
Range("B12").Select
Range("B13").Select
Range("B14").Select
Range("B15").Select
Range("B16").Select



End If
Application.Goto Reference:="OptionExplicit"
End Sub
 
D

David M. Marcovitz

This wouldn't be extremely difficult, but it is a bit more complicated
than you think. Are you saying that after each question is answered, a
new slide is created with the new information, or do you want all the
information about one person to be placed on one slide, and then another
slide is created for the next person? I see that you recorded the macro
for Excel. Do you have any experience writing your own macros or are you
looking to hire someone to do this?
--David
 
C

Cedric

I was looking to have all the information enter on one slide and then move on
to next slide for next person. I have worked with macros before.
 
D

David M. Marcovitz

OK. It is just that macros in PowerPoint are a bit different than macros
in Excel. I actually have an example that does something related to what
you want to do. Look for example 10.2 on my site:

http://www.PowerfulPowerPoint.com/

Go to "Examples by Chapter" and "Chapter 10." You are looking for the
AddWorkTogetherSlide procedure. It asks for information and then
displays that information on a new slide. It is fairly simplistic but
the same idea as what you want.

--David
 
C

Cedric

David, I got it to let me enter the information, but where does the
information go at? It is not on the screen and I cannot see the results.
 
D

David M. Marcovitz

Ah. In this example, there is a secret button in the top left the first
slide. If you click on that, it will take you to the list of students
who "chose to work with you."
--David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top