Just want simple tickbox in non-Slideshow PowerPoint

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
In an Excel workbook:
Insert a checkbox (either Form Control or Active-x ) directly onto a worksheet
Cancel Design Mode if required
Click on checkbox (to check)
Click again on checkbox (to uncheck)
Hi. I'm not sure where you've determined that I'm referencing an Excel document - my question title states PowerPoint and when you asked for further clarification I said I had created a 'workbook' for someone to work through ticking responses and choices - not an Excel worksheet.

However the functionality you describe is of course exactly what I want (just in PowerPoint (and not in slideshow mode)).
 

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
In order for this to work, run the trap events routine first:
Thanks v much for this Worf I'll certainly give this a go.

Bear with me as I have VBA'd before but I'm nowhere even approaching competent let alone expert (!) so, these here checkboxes are on several pages of this document so do I need to add the VBA to every page where I need it or as its written does this cover of anywhere in this document?

Also, what type of module do I choose - User Form, Module, Class Module?

Cheers
 

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
In order for this to work, run the trap events routine first:
Thank you very much indeed for this. Do I run it in a module or class module?

Does the VBA you've provided cover all the sheets (ie 'where' should I 'put' it exactly in terms of the structure eg do I need to add it to every page that has checkboxes?). Low competency VBAer here for which, apologies.
 

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
Apologies for potentially posting a Reply twice - had a glitch with Windows.
 

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,009
  • The code covers all check boxes on all slides.
  • I made a change to the class module code, use version below.
  • At the VBE, choose Insert>Module and paste the indicated code from the other post. Note the green comments on the code.
  • Choose Insert>Class Module, rename it as indicated and paste the corresponding code.
  • Run the trap event code and that is it. Would you like to have my test presentation?

VBA Code:
'PowerPoint class module named EventClass

Public WithEvents PPTEvent As Application

Private Sub Class_Terminate()
MsgBox "EventHandler is now inactive.", vbInformation + vbOKOnly, _
"PowerPoint Event Handler Example"
End Sub

Private Sub PPTEvent_WindowSelectionChange(ByVal Sel As Selection)
If Sel.Type <> 0 And Sel.Type <> 1 Then
    If Sel.Type = 2 And Sel.ShapeRange.Name Like "CheckBox*" Then
        Sel.ShapeRange.OLEFormat.Object.Value = _
        Not Sel.ShapeRange.OLEFormat.Object.Value
        Sel.Unselect
    End If
End If
End Sub

Private Sub Class_Initialize()
MsgBox "The EventHandler class has been initialized."
End Sub
 

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
Thanks for this. I've put it in now and re-saved as macro-enabled PowerPoint. Let me show you what I did and how that looked in F11. Then the next image is what happens if I click into a checkbox in the document, I get this click module. When you'd written 'rename it' I couldn't see where there was an option for me to rename anything (I thought you may have meant the name of the module but I couldn't see a way to do this).
 

Attachments

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,009
Take a look at my test presentation:

 

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
Thanks very much for sharing that with me - but I just don't know what's happening or what I need to do ......

In your document if I click on the checkbox (bearing in mind I'm doing this NOT in Presenter/Slideshow mode) nothing at all happens...?

What you have the tick box is ticked, I'm expecting when I click on it the tick will go (repeat, repeat, repeat, like a toggle in effect). But nothing happens so I'm a bit unsure what I need to do.
 

Worf

Well-known Member
Joined
Oct 30, 2011
Messages
4,009
You need to start by running the trap events routine, did you do that?
 

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
365
Platform
Windows
You need to start by running the trap events routine, did you do that?
Hi there. I don't know how to 'run trap events'... sorry! :eek:
I can see 'Run' (giving options of Run sub/user form, Break or Reset) and I can see Module (General) Trap events. What I do with that I'm really sorry but I don't know how to do that.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,015
Messages
5,508,814
Members
408,695
Latest member
MarcelCohen

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top