Results 1 to 2 of 2

Thread: PowerPoint VBA to change shape color on Click

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Lightbulb PowerPoint VBA to change shape color on Click

    Hello all,
    I am trying to create an powerpoint Quiz template. Each slide have a question with 4 options below. These 4 options are rounded Rectangles with No-Fill.
    I am looking for a VBA which can be assigned to each of these shapes, which On-Click, must change color to green if answer is correct and change color to Red if answer is wrong.

    In the attached template, in slide 1, option 1 is correct answer and other 3 are wrong.
    In slide 2, Option 3 is correct answer and other 3 are wrong.

    Can anyone please help me with the code.? I know i am asking it from scratch, sorry for that, but i am very new to PowerPoint VBA.

    Thanks in advance
    Attached Files Attached Files

  2. #2
    VBAX Master
    Feb 2007
    Assign either of these to the corresponding shape

    Sub isWrong(oshp As Shape)
    oshp.Fill.ForeColor.RGB = vbRed
    End Sub
    Sub isCorrect(oshp As Shape)
    oshp.Fill.ForeColor.RGB = vbGreen
    End Sub

    However there are several problems with this approach

    A The user can click all of the shapes
    B The colours will not reset to white when the quiz is over.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts