Create Multiple Fill in the Blanks Interactive PowerPoint Presentation [PPT VBA Tutorial]

Published 2020-05-22
Download Fill in the blanks PowerPoint Template for Free: pptvba.com/fill-in-the-blanks/#multiple
Download Premium Template: pptvba.com/download-fill-in-the-blanks-powerpoint-…
Part 1 and Part 2:    • How to make Fill in the Blanks Game i...  

Add multiple ActiveX TextBoxes to our PowerPoint Slide thus, having multiple blanks in our Fill in the Blanks Game in PowerPoint. This seems simple enough, we now just have to cross check each and every attempted answer with the correct answer shape which is placed outside the slide.

Rename “AA” as “AA1” via selection pane and do the same with CA, i.e “CA” becomes “CA1”. Now, we just have to duplicate our code which will equate both the values one-by-one.

Instead of duplicating the code, we can use a For Loop which will generate number from 1 To 4 in this case. So, AA1 = CA1 to AA4 = CA4 is checked.

Also, changing the shape name from “CA” to “CA1” in multiple slides can be very tedious. Thus, we can use a simple VBA Macro Code in Microsoft PowerPoint which will allow us to rename the Shape’s name:

For i = 3 To 6
ActivePresentation.Slides(i).Shapes("AA").OLEFormat.Object.Name = "AA1"
ActivePresentation.Slides(i).Shapes("CA").Name = "CA1"
Next i

Cross checking AA with CA multiple times using For Loop in PPT VBA
During our loop, we increase the value of the “CorrectBlanks” integer by +1 every time “AA” & i is equal To “CA” & i.

We also set the value of NoOfBlanks to be equal to i.
Thus, the above integer keeps getting updated until an error pops up saying that the Shape “AA” & i doesn’t exist.

At the point of time, we go to CheckIfAllCorrect: in our VBA Macro and then add an If-Condition.

If the number of blanks is equal to the number of CorrectBlanks, we can successfully move on to the next question.

And once that happens, we can reset the value of CorrectBlanks to 0.

----

Intro music by Ashwin Subrahm
Background music: Distant Lakey Inspired

I also do freelancing, contact me:
Bhavesh Shaha,
[email protected]
youtube.com/bhaveshshaha
www.instagram.com/basicallybhavesh (DMs are open)

www.pptvba.com

All Comments (17)
  • @glennapoles1292
    yeah my Man...you're skill in VBA is commendable..my salute to you Sir..
  • @katjaw9957
    Wow.... It's great I will try this on weekend. Thank you very much I can learn a lot while watching your videos
  • Thank you for your prompt reply. Your tutorial is really fantastic. Today I received your email. Thank you very much.
  • @al1453jj
    Hi Bhavesh, i really LOVE your videos. you have often saved me from despair ;-). Thank you. One question: Is it possiblie to activate the textboxes by using the tab-key? I deal a lot with digital accessibility. this function would be great for that. Thanks in advance :)
  • @billminimum6695
    This is fantastic Bhavesh, I need to watch all your presentations. Could you add a print results to the final slide that would give the student name, date and score. Thanks again.
  • @katjaw9957
    Jeah- got time to create it this weekend and your code works greate- next weekend i will try to insert questions with drop down answers.
  • Thank you very much for such great content! You’re awesome! And also I have a question for you: is it possible to add to this presentation a slide, where a person can read the task and to write his voice as an answer? I understand that such question couldn’t be count as correct or wrong, but still. For example, I need children to describe a picture and I need them talk, so I need to write their voice. Thanks a lot for your job!
  • Bhavesh Sir. i really love your tutorials, is it possible to have virtual training with you please?
  • @alvismar8389
    you are brilliant in every ppt u do... pls help me on how i could make the score of the student in the ppt be recorded in excel... and similarly how can my ppt automatically run when the student open it?
  • @madhavpokhara
    So nice. The coding are difficult to visualize. Can you please give a link to copy the code
  • @taher172007
    Can we control animation in PowerPoint by PowerPoint vba? thanks
  • @wanhazirah47
    How to make only one slide with various fill in the blanks questions 😭😭help me please, how to do with ‘ for i 1-6’ bcause I only have 1slide for the question
  • @Joseorlando98
    You go too fast for a beginner to understand and follow. Please make a powerpoint presentation from scratch.