PowerPoint Help needed with VB

Joined
Nov 27, 2018
Messages
1
Reaction score
0
I dont know why, but this piece of code doesnt seem to work.. Any help???


Private Sub CommandButton1_click()
If Slide1.m.Text = g Then
ActivePresentation.SlideShowWindow.View.GotoSlide 3

ElseIf Slide1.m.Text = h Then
ActivePresentation.SlideShowWindow.View.GotoSlide 4

Else
ActivePresentation.SlideShowWindow.View.GotoSlide 1

End If
End Sub


anyone help?
 

Abraham Andres Luna

Child of God
Joined
Mar 14, 2018
Messages
699
Reaction score
227
Well I see a couple things wrong with your code. First of all, what is the Slide1 object type? and what is the m property of that object, what is it's type? And then you don't have g defined within that Sub so it will throw a variable not defined error. Same thing goes for h, are you meaning to enclose that in quotes to compare them as strings?
 

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