Version 1.2
If you have already purchased this Software, let me take a moment to thank you for being a loyal customer
You are entitled to free lifetime updates for ALL future builds
This documentation is to help you understand the Software and to give you a more meaningful insight into what it can do. Please go through the documentation and read it carefully · Basic Excel and some VBA skills will be required
You will need the following Excel Version & Prerequisite to use this Software
No support is provided for customization or development of this Software
CheckboX is a lovely animated Checkbox for Excel made from 2 Shapes, a Checkbox and a Tick. Both Shapes have a Macro assigned. When the Checkbox is clicked the animation rotates and fades a small green Tick in using easeOutQuad (fast, then slow acceleration). When the green Tick is clicked the Checkbox is highlighted with a green line and then a similar animation is ran to rotate and fade it in. You can duplicate and/or add the Code and Shapes very easily into a new or existing Project and capture which Checkboxes are Ticked
Right-click and extract the CheckboX.zip archive. I have included the images that I used for the Checkbox and Ticks. Open the 'CheckboX_v1.1.xlsm' File. A License Worksheet is included in the Workbook. Select the "CheckboX" Worksheet. Here you will find the list of 5 Checkboxes. Click on each Checkbox to Tick the Checkbox. Press ALT+F8 and run the 'TestAllCheckboxStates1()' Macro to see which Checkboxes are Ticked. Press ALT+F11 to enter the VBA Editor. Scroll down and view the Code used for the Checkboxes. Before continuing, it is advised to take a Backup as you will no doubt want to Copy Checkboxes and Code from this Workbook. I have included Version 1.2 'CheckboX_v1.2.xlsm' as a new File included in the download - this Workbook uses transparent PNG's for the Checkboxes and the Ticks
The Shape use for the Checkbox is linked to the 'CheckboxClick()' Macro. This Macro enables the animation from Checkbox to Tick. The 'Tick' Macro is called here and it takes 3 Parameters, the Name of the Shape (I use Application.Caller), an Optional FrameSpeed (I use 0.06) and an Optional LineColour. You can react here to the click if you want to and if so, add your Code to the commented out Section beginning 'Your Code'. Please Note: you should change these Public Macros to Private Macros using the 'Private' prefix as calling them via ALT+F8 will result in an error - it's up to you, I left them as Public so that you can link more Checkboxes if required. You could of course replicate this Macro and change it to your own Code, just remember to set the 'IsRunning' Boolean variable to True after an initial check and Exit if it is already True to prevent multiple Mouse clicks
' CheckboxClick, the one and only Checkbox Subroutine. handles all clicks and animation Public Sub CheckboxClick() ' prevent multiple clicks If IsRunning Then Exit Sub IsRunning = True ' perform Tick animation, FrameSpeed & LineColour are Optional Parameters... Tick AnimationShape:=ActiveSheet.Shapes(Application.Caller), _ FrameSpeed:=0.06, _ LineColour:=RGB(59, 89, 153) ' Your Code if you need to complete any immediate action from a Checkbox click ' - ie. (checkbox is checked), Call update settings... 'Debug.Print "Checkbox " & Right(Application.Caller, 2) & " is checked" IsRunning = False End Sub
The Shape use for the Tick is linked to the 'TickClick()' Macro. This Macro enables the animation from Tick to Checkbox. The 'Checkbox' Macro is called here and it takes 3 Parameters, the Name of the Shape (I use Application.Caller), an Optional FrameSpeed (I use 0.06) and an Optional LineColour. You can react here to the click if you want to and if so, add your Code to the commented out Section beginning 'Your Code'. Please Note: you should change these Public Macros to Private Macros using the 'Private' prefix as calling them via ALT+F8 will result in an error - it's up to you, I left them as Public so that you can link more Checkboxes if required. You could of course replictae this Macro and change it to your own Code, just remember to set the 'IsRunning' Boolean variable to True after an initial check and Exit if it is already True to prevent multiple Mouse clicks
' TickClick, the one and only Tick Subroutine. handles all clicks and animation Public Sub TickClick() ' prevent multiple clicks If IsRunning Then Exit Sub IsRunning = True ' perform Checkbox animation Checkbox AnimationShape:=ActiveSheet.Shapes(Application.Caller), _ FrameSpeed:=0.06 ' Your Code if you need to complete any immediate action from a Tick click ' - ie. (checkbox is not checked), Call update settings... 'Debug.Print "Checkbox " & Right(Application.Caller, 2) & " is not checked" IsRunning = False End Sub
The Checkbox Shape is a Shape with an Image of a small grey Checkbox but this can be any Icon or Image you like. It is also where you should link your 'CheckboxClick()' Macro ie. right-click on Shape and choose Assign Macro... (make sure the Worksheet Protection is removed first). To view the Shape and change the Formatting or Image, right-click on a Shape and use the Selection Pane on the Arrange Group of the PAGE LAYOUT Tab of the Ribbon. Right-Click and then choose 'Format Picture...'
The Tick Shape is a Shape with an Image of a small green Tick but this can be any Icon or Image you like. It is also where you should link your 'TickClick()' Macro ie. right-click on Shape and choose Assign Macro... (make sure the Worksheet Protection is removed first). To view the Shape and change the Formatting or Image, right-click on a Shape and use the Selection Pane on the Arrange Group of the PAGE LAYOUT Tab of the Ribbon. Right-Click and then choose 'Format Picture...'
Both the Checkbox and the Tick Shapes are animated using a Frame Timer. They have Rotation and Transparency animations in order to Fade in or out and rotate nicely in sync. They also have an easing Function applied called 'easeOutQuad' which starts the animation quickly, then slows dow towards the end of the animation. Here is the easing Function that I use:
' easeOutQuad, fast acceleration, then slow Function easeOutQuad(ByVal t As Double, ByVal b As Integer, ByVal c As Integer, ByVal d As Double) t = t / d easeOutQuad = -c * t * (t - 2) End Function
You can add some nice effects to the Shapes to make the Checkboxes stand out or 'jazz' up the Tick. In the first Image below I have addeda Shadow effect on Checkbox, full reflection, 8pt offset on Tick and a Shadow effect on Checkbox with solid Fill in Red - the first Styles Image shows the Checkbox before the Tick is applied for the first Checkbox and then the second Styles Image shows the Tick with its reflection
Just slecting a CheckboX is not enough, right!? You need to know which ones are selected or ticked. Well Code is provided to do just that. You can add the Code below to check whether a specific CheckboX is selected:
'-¬ TestCheckBoxState, uses the Checked Function to test the state of one of the Checkboxes, 'checkbox10' Private Sub TestCheckboxState() If Checked("checkbox10") Then MsgBox "checkbox10 is checked" Else MsgBox "Checkbox is not checked" End Sub
You can check to see if any of the CheckboXes are selected or ticked using the Code below (it also can return the results in the order that the CheckboXes were created/named):
'-¬ TestCheckBoxState1, uses the Checked Function to test the state of all of the Checkboxes if their Shape Name contains 'checkbox' ' returns the Shapes in the correct order ' you can also bring back what the Checkbox relates to by storing an array of the list items Public Sub TestAllCheckboxStates1() ' vars Dim lngShapes As Long Dim objShape As Shape Dim vntArray As Variant vntArray = Array("write a LETTER to Santa", _ "Make mince pies", _ "Go CAROL singing", _ "DECORATE a gingerbread house", _ "Hang STOCKINGS (very important)", _ "KISS under the mistletoe", _ "Go to a Local Christmas FESTIVAL", _ "Sip on Hot Chocolate by the Fire", _ "Make a Christmas TUNE Playlist") For lngShapes = Sheet1.Shapes.Count To 1 Step -1 Set objShape = ThisWorkbook.Sheets("Checkbox").Shapes(lngShapes) If InStr(1, objShape.Name, "checkbox", vbTextCompare) > 0 Then If Checked(objShape.Name) Then MsgBox objShape.Name & " is checked, item: " & vntArray(Right(objShape.Name, 2) - 10) End If Next lngShapes ' ' if you don't care about the order ' For Each objShape In ThisWorkbook.Sheets("Checkbox").Shapes ' If InStr(1, objShape.Name, "checkbox", vbTextCompare) > 0 Then ' If Checked(objShape.Name) Then MsgBox objShape.Name & " is checked, item: " & vntArray(Right(objShape.Name, 2) - 10) ' End If ' Next objShape End Sub
This Subroutine checks for a selected/ticked CheckboX and returns instantly upon a hit:
'-¬ TestCheckBoxState2, uses the Checked Function to test the state of all of the Checkboxes if their Shape Name contains 'checkbox' ' if we get a hit on 'checkbox10' then the Subroutine ends, we know Checkbox10 is checked Private Sub TestAllCheckboxStates2() ' vars Dim objShape As Shape Dim vntArray As Variant For Each objShape In Sheet1.Shapes If objShape.Name = "checkbox10" Then If Checked(objShape.Name) Then MsgBox "checkbox10 is checked" Exit For End If End If Next objShape End Sub
The Code is limited to 100 Checkboxes and Ticks without modification
This is a Screen Shot of the CheckboX Workbook with a Xmas To Do list available for Purchase. You can just see the Checkbox is animating following a click on the green Tick Shape
This is a Screen Shot of Version 1.2 of the CheckboX Workbook using transparent PNG's as Icons or Images for the Checkbox and Tick. I have also added a Drop-shadow to the 'Christmas To Do List'
Here I run through the Checkbox list testing the animations
Can I copy the Checkboxes?
Yes just select both Shapes and use Copy & Paste. Then rename the Shapes as 'checkbox15' and 'tick15' and the Code will work for the extra Checkbox
Please remember you have purchased very affordable Software and you have not paid for a full-time Software design agency - I am but one man. Occasionally I may help with small tweaks, but these requests will be put on a much lower priority due to their nature. You have not PAID for Support, Support is 100% optional and I provide it for your convenience, so please be patient, polite and respectful
You can find the version history in the Code Module for any Macro-enabled Software or read more information below. The latest Version is always shown first
06.11.2018 (Version 1.2) Created a second File and used Transparent PNG so that Checkboxes can be placed upon a coloured background --- 04.11.2018 (Version 1.1) Added the ability to change the Colour of the Line for the Checkbox animation Included the Ticks and Checkbox images I used into a new download File CheckboX.zip Added some Style effects --- 03.11.2018 (Version 1)