Go homeTerence W. Cavanaugh Ph. D.
About me projects presentations Publications teaching Related sites

Some Interactive Macros (Visual Basic for Applications)
You Can Use With PowerPoint Presentations

Using the Visual Basic for Applications that already exists in PowerPoint you can create more interactive and engaging presentations.

You can assess the macro writing section through the Tools à Macros à Visual Basic Editor menus of the program.


Sub timeline1()

'

' Macro created by Cavanaugh

'This macro will cause a message box to appear and display the text when a symbol is selected.

Dim timeline1 As String

timeline1 = "Major Events of the 20's through the 60's that impacted Science Fiction:" & vbCr & "World War II, Nuclear Weapons and Energy, the Cold War, and the Space Program"

MsgBox timeline1, buttons:=vbInformation + _

vbOKOnly, Title:="Insight"

End Sub


Sub metro()

'

' Macro created by Cavanaugh

'This macro will require the user to input information, such as notes or the answer to a question.

Do

Description = "Write a description (complete sentence) of how the scientist is portrayed in the 20's: You should at least make note of their clothes, gender, age, and setting."

metroa = InputBox(Description, "notes", , vbOKOnly)

n20s = n20s + metroa + vbCr

If metroa <> "" Then

MsgBox prompt:="Interesting ideas you entered: " & vbCr & n20s & vbCr & " Let's continue"

Else

Beep

no_note = "You have not entered any notes yet."

MsgBox no_note, buttons:=vbCritical + vbOKOnly, Title:="Try again"

Beep

End If

Loop While metroa = ""

End Sub


Sub pptuser()

'

' Macro created by Cavanaugh

'This macro will require the user to input information, and then uses that information in a message

'box and resets data fields to null.

ppt_user = InputBox(prompt:="Please enter your name:")

MsgBox prompt:="Hello " & ppt_user & ". Let's get started."

n20s = ""

n30s = ""

n40s = ""

n50s = ""

n60s = ""

n70s = ""

n80s = ""

n90s = ""

End Sub


Sub films()

'

' Macro created by Cavanaugh

'This macro will display in a message box any information that the user has

' inputted, 'separating each data field onto a separate line.

note_txt = Now & vbCr & ppt_user & "'s ideas were:" & vbCr & _

"For the 20's: " & n20s & vbCr & vbCr & _

"For the 30's: " & n30s & vbCr & vbCr & _

"For the 40's: " & n40s & vbCr & vbCr & _

"For the 50's: " & n50s & vbCr & vbCr & _

"For the 60's: " & n60s & vbCr & vbCr & _

"For the 70's: " & n70s & vbCr & vbCr & _

"For the 80's: " & n80s & vbCr & vbCr & _

"And finally for the 90's: " & n90s

MsgBox prompt:=note_txt

End Sub


Sub notebox()

' Macro created by Cavanaugh

'This macro will display in a new box any information that the user has inputted,

'separating each data field onto a separate line, which can then be printed.

note_txt = Now & " " & ppt_user & "'s ideas were:" & vbCr & _

"For the 20's: " & n20s & vbCr & _

"For the 30's: " & n30s & vbCr & _

"For the 40's: " & n40s & vbCr & _

"For the 50's: " & n50s & vbCr & _

"For the 60's: " & n60s & vbCr & _

"For the 70's: " & n70s & vbCr & _

"For the 80's: " & n80s & vbCr & _

"And finally for the 90's: " & n90s

notes.Show

End Sub


Sub quiz()

' Macro created by Cavanaugh

'This macro will display a new box in which the user can make choices,

'once a choice is made the user can get immediate feedback on its correctness.

Question.Show

End Sub

Private Sub CommandButton1_Click()

End Sub

Private Sub question_Click()

Me.hide

End Sub

Private Sub checkanswer_Click()

If OptionButton6 = True Then

MsgBox ("Correct, please continue.")

Me.hide

Else:

MsgBox ("Incorrect. Try again")

End If

End Sub

Private Sub UserForm_Click()

End Sub