Results 1 to 1 of 1

Not in the Beta Channel, but really don't want to wait for Boolean CheckBoxes?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    293

    Not in the Beta Channel, but really don't want to wait for Boolean CheckBoxes?

    For those like myself who are unable to join the Beta Channel due to your companies IT policies, but really want those Boolean Checkboxes you've seen on Social Media, I've worked out a solution!

    It's not perfect, but it works exactly the same from what I can tell.

    1. Open Personal.xlsb
    2. Create a module
    3. Enter this code;

    
    Sub InsertCheckbox()
        Dim cb As CheckBox
        Dim rng As Range
        
        'Select the range
        Set rng = Selection
        
        'Loop through each cell in the range
        For Each cell In rng
            ' Insert a checkbox in each cell
            Set cb = ActiveSheet.CheckBoxes.Add(cell.Left, cell.Top, cell.Width, cell.Height)
            
            'Set the value to unchecked
            cb.Value = False
            cb.Caption = ""
            
            'Link the checkbox with the cell value
            With cb
                .LinkedCell = cell.Address
                .Display3DShading = False
            End With
    
            'Set the font to match the cells colour so cell Value is hidden
            With cell
                .Font.Color = .Interior.Color
            End With
            
        Next cell
    End Sub
    4. Save to Personal.xlsb

    5. Add to the Ribbon for quick access.

    Now all you have to do is select the Cell(s) you wish to insert the CheckBox(s) in, and hit the button in you created on the ribbon.

    When the CheckBox is Checked, referencing the cell it sits in will return TRUE, and unchecked will return FALSE.

    Enjoy!
    Last edited by PrizeGotti; 03-15-2024 at 12:01 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calling Windows API with boolean argument in 64bit Excel: long, byte or boolean?
    By 6diegodiego9 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2022, 05:49 AM
  2. [Excel Beta Channel] Office.js function assigns a value from one table to another table
    By ExcelIsMyFrenemy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-25-2021, 03:47 PM
  3. Wait for one IE page to load then wait for a second
    By ckemp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-12-2017, 11:29 AM
  4. [SOLVED] Exit Workbook_BeforeClose(Cancel As Boolean) if a public boolean = true
    By meabrams in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2016, 06:10 AM
  5. Calculate Alpha, Beta for use in Beta Dist function
    By Rapjam in forum Excel General
    Replies: 2
    Last Post: 09-17-2012, 09:58 PM
  6. irc channel or help channel for excel programming
    By morpheus305 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-24-2009, 11:27 PM
  7. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) problem
    By 2funny4words in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2009, 07:28 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1