Just want simple tickbox in non-Slideshow PowerPoint

Helpmehelpme

New Member
Joined
Jul 19, 2020
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi
I'm sure there must be VBA for this, to take a tickbox inserted into a slide from the Developer tab, and make it so that, without needing to be in Slideshow to be able to click the tickbox, you would be able to tick the checkbox!

I'd like it done with VBA so there's nothing for the user to do specifically. When they see a checkbox I'd like them to either just be able to ignore it altogether, or click it and if they do that, a tick mark appears. If they change their mind and click it again, the tick mark would go.

I'm convinced this is possible but with a bit of VBA and the tickbox from the Develop tab (without going into User Forms and the like) - am I right and can anyone help??

I don't need any messages to appear, I'm not looking to go through a presentation to find checked or unchecked tickboxes, I just want the user, NOT in Slideshow mode, to be able to tick and untick a blessed tick box - that's it :-).

Any help would be v v gratefully received as I cannot find anything that quite seems to fit the bill.

Many thanks indeed.
 
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)).
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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
 
Upvote 0
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.
 
Upvote 0
  • 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
 
Upvote 0
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

  • Module & class module snip.png
    Module & class module snip.png
    117.5 KB · Views: 38
  • Upon clicking clickbox in document.png
    Upon clicking clickbox in document.png
    4 KB · Views: 38
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,638
Messages
6,173,494
Members
452,516
Latest member
druck21

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top