title: How to Generates a random pair of unique images in VBA Powerpoint
body: <p>If I want to create a random order to select another pair from my image. , not repeating the random pair i've previously picked, i.e. so that once i've gone through 56 random unique images i.e. 26 random pairs, the game is over, and reset to my original 57 images and start picking random pairs again. Can this be done in VBA Powerpoint?</p>
  <p>This is the sub I am using:</p>
  <pre><code>Sub RandomImage()
  
     Dim i As Long  
  
     Dim posLeft As Long
  
     For i = 1 To 2
  
    Randomize
  
   RanNum% = Int(57 * Rnd) + 1
  
   Path$ = ActivePresentation.Path
  
   FullFileName$ = Path$ + &quot;/&quot; + CStr(RanNum%) + &quot;.png&quot;
  
   posLeft = 50 + ((i - 1) * 400)
  
   Call ActivePresentation.Slides(1).Shapes.AddPicture(FileName:=FullFileName$, LinkToFile:=msoTrue, SaveWithDocument:=msoTrue, Left:=posLeft, Top:=100, Width:=400)
  
  Next
  
  End Sub
  </code></pre>