• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Hangman Graphics Automation

XLPadawan

Member
I've created a crude Hangman game in Excel 2016. When an incorrect letter is guessed I have to manually run a macro to insert the next body part. What I'd like is to have the next body part inserted automatically after an incorrect letter is entered. How can I do that?
 

Attachments

  • Hangman.xlsm
    58.7 KB · Views: 5
This attached macro, to be pasted in the "Hangman"'s module as it is triggered by the Worksheet_Change event, will do the automatism you need but the sample file you have attached is very "dirty" and needs some fixing/alligning of the shapes before you can use my macro effectively.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("B13:AA13")) Is Nothing Or Range("E10").Value = 0 Then Exit Sub
    Application.EnableEvents = False
    Select Case Range("E10").Value
        Case Is = 1
            Call HangmanHEAD
        Case Is = 2
            Call HangmanBODY
        Case Is = 3
            Call HangmanRightArm
        Case Is = 4
            Call HangmanLEFTARM
        Case Is = 5
            Call HangmanRIGHTLEG
        Case Is = 6
            Call HangmanLEFTLEG
    End Select
    Application.EnableEvents = True
End Sub
 
Last edited:
A sample working only under Windows, in manual mode and​
in different dictionary modes with a standard installation of Mozilla Firefox or Thunderbird​
with two endings depending on the number of letters used :​
 

Attachments

  • Pendu & wav .zip
    215.8 KB · Views: 5
Back
Top