title: Shortening GoToSlide Command in VBA?
body: <p>I'm making a PowerPoint where I'm constantly using this command to jump around slides:</p>
  
  <pre><code>With SlideShowWindows(1)
      .View.GoToSlide (.Presentation.Slides(x).SlideIndex)
  End With
  </code></pre>
  
  <p>I wanted to shorten that by writing a module that would shorten it, but since I'm a newbie and don't really know how, I really need help. This is the "SlideControl" module I've written:</p>
  
  <pre><code>Public Intro As String, BIOS As String, OSBegin As String, InitialSetup As String, LogIn As String, Desktop As String
  
  Public Sub GoToSlide(Slide)
  
  Intro = SlideShowWindows(1).Presentation.Slides(1).SlideIndex
  BIOS = SlideShowWindows(1).Presentation.Slides(2).SlideIndex
  OSBegin = SlideShowWindows(1).Presentation.Slides(5).SlideIndex
  InitialSetup = SlideShowWindows(1).Presentation.Slides(6).SlideIndex
  LogIn = SlideShowWindows(1).Presentation.Slides(9).SlideIndex
  Desktop = SlideShowWindows(1).Presentation.Slides(11).SlideIndex
  
  SlideShowWindows(1).View.GoToSlide (Slide)
  
  End Sub
  </code></pre>
  
  <p>That is the entire module, nothing else at the end. Of course I'm new to coding, so if the code looks wrong please help me correct it. I think I should be able to go to the intro slide using this command:</p>
  
  <pre><code>GoToSlide (Intro)
  </code></pre>
  
  <p>Then I get this error when I call it:</p>
  
  <pre><code>Compile error:
  
  Only comments may appear after End Sub, End Function, or End Property
  </code></pre>
  
  <p>Can anyone help me fix this? I'd appreciate it very much.</p>