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?
 
Ad

Advertisements

Joined
Mar 14, 2018
Messages
540
Reaction score
170
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

Similar Threads

Excel Need some help with VB in Excel 0
Excel Excel VB help 0
Excel Excel VB Help 0
Excel Excel VB - exporting & importing data 0
Access Importing Access Tables using VB / SQL 2
Excel Excel VB - Copy only the colour format from columns 0

Top