I want to share with You guys this RNG Macro, made to spice things up in a PPT Games. Sub Rng()
Decisión = Int(Rnd() * 4) + 1
If Decisión = 1 Then
SlideShowWindows(1).View.GotoSlide (3)
End If
If Decisión = 2 Then
SlideShowWindows(1).View.GotoSlide (4)
End If
If Decisión = 3 Then
SlideShowWindows(1).View.GotoSlide (5)
End If
If Decisión = 4 Then
SlideShowWindows(1).View.GotoSlide (6)
End If
End Sub
If You guys need help or explanations please feel free to ask.
Download Link: https://www.mediafire.com/file/mjybg9j18wj1661/RNG_Macro.ppsm/file
Hi Breaker,
You super easily shrink your macro to just one short single line of code. Like so:
SlideShowWindows(1).View.GotoSlide Int(Rnd * 5) + 3
I have a function that generates a random number between two given numbers:
Function RandNum(min, max, Optional digits As Integer = 0) RandNum = Math.Round((max - min) * Rnd, digits) + min End Function
Feel free to use it :)