Help needed with VB

PowerPoint Discussion in 'Microsoft Office' started by Paleolithic_Coder, Nov 27, 2018.

  1. Paleolithic_Coder


    Nov 27, 2018
    Likes Received:
    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

    ActivePresentation.SlideShowWindow.View.GotoSlide 1

    End If
    End Sub

    anyone help?
    Paleolithic_Coder, Nov 27, 2018
    1. Advertisements

  2. Paleolithic_Coder

    Abraham Andres Luna

    Mar 14, 2018
    Likes Received:
    Spring Hill, FL 34608
    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?
    Abraham Andres Luna, Nov 28, 2018
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.