Forum Discussion

ChakritW's avatar
ChakritW
Copper Contributor
Nov 08, 2023
Solved

How to expand checkbox into column cells in Mac Excel?

Hi,

 

I'm using Excel for Mac version 16.78.3 on Mac OS Monterey 12.6, and trying to add checkboxes to my column cells which are "Formatted as Table". I've read some tutorials, and can now add a checkbox , delete the label text, and manually link it to the corresponding cell at a time. But I can't seem to "expand" and copy the checkbox into other cells in the column automatically.

Is there a way to do this at all in Mac Excel, and how?

Thanks!

 

  • ChakritW 

    In Excel for Mac, you cannot directly expand or copy a checkbox to multiple cells in a column using the drag-fill handle or similar methods like you might do with other data types, so far I know. Checkboxes are treated differently and require manual placement and linking to cells, which can be a bit more time-consuming.

    Unfortunately, there is not an automated way to quickly replicate checkboxes in a column in Excel for Mac. You will need to manually add and link each checkbox to its corresponding cell.

     

    If you have a large number of checkboxes to add, you may consider to exploring VBA (Visual Basic for Applications) to automate this process, but that would require a different approach and may not be applicable on a Mac. In Excel for Mac, VBA (Visual Basic for Applications) is not as robust as it is in the Windows version of Excel, and it does not support all the features available on Windows. While you can use VBA for various tasks, such as automating repetitive processes, creating custom functions, or working with data, the functionality is more limited.

    Adding checkboxes to cells and linking them to cells in a column using VBA in Excel for Mac is possible, but it involves a more complex process compared to Excel for Windows.

    Here is a simplified example of how you might approach it (code is untested please backup your file):

    Sub AddCheckboxesAndLinkToCells()
        Dim ws As Worksheet
        Dim cell As Range
        Dim cb As CheckBox
        Dim topCell As Range
    
        ' Set the worksheet where you want to add checkboxes
        Set ws = ThisWorkbook.Sheets("Sheet1")
    
        ' Set the top cell where the first checkbox will be placed
        Set topCell = ws.Cells(2, 1)
    
        ' Loop through each cell in the column and add a checkbox
        For Each cell In ws.Range(topCell, topCell.End(xlDown))
            ' Add a checkbox
            Set cb = ws.CheckBoxes.Add(cell.Left, cell.Top, 50, 50)
            
            ' Link the checkbox to the corresponding cell
            With cb
                .LinkedCell = cell.Address
                .Text = ""
            End With
        Next cell
    End Sub

    Please note that VBA in Excel for Mac might have limitations compared to Excel for Windows. Additionally, you need to enable the "Developer" tab in Excel's Preferences to access VBA features. The text and steps were edited with the help of AI.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

    Was the answer useful? Mark as best response and Like it!

    This will help all forum participants.

  • NikolinoDE's avatar
    NikolinoDE
    Gold Contributor

    ChakritW 

    In Excel for Mac, you cannot directly expand or copy a checkbox to multiple cells in a column using the drag-fill handle or similar methods like you might do with other data types, so far I know. Checkboxes are treated differently and require manual placement and linking to cells, which can be a bit more time-consuming.

    Unfortunately, there is not an automated way to quickly replicate checkboxes in a column in Excel for Mac. You will need to manually add and link each checkbox to its corresponding cell.

     

    If you have a large number of checkboxes to add, you may consider to exploring VBA (Visual Basic for Applications) to automate this process, but that would require a different approach and may not be applicable on a Mac. In Excel for Mac, VBA (Visual Basic for Applications) is not as robust as it is in the Windows version of Excel, and it does not support all the features available on Windows. While you can use VBA for various tasks, such as automating repetitive processes, creating custom functions, or working with data, the functionality is more limited.

    Adding checkboxes to cells and linking them to cells in a column using VBA in Excel for Mac is possible, but it involves a more complex process compared to Excel for Windows.

    Here is a simplified example of how you might approach it (code is untested please backup your file):

    Sub AddCheckboxesAndLinkToCells()
        Dim ws As Worksheet
        Dim cell As Range
        Dim cb As CheckBox
        Dim topCell As Range
    
        ' Set the worksheet where you want to add checkboxes
        Set ws = ThisWorkbook.Sheets("Sheet1")
    
        ' Set the top cell where the first checkbox will be placed
        Set topCell = ws.Cells(2, 1)
    
        ' Loop through each cell in the column and add a checkbox
        For Each cell In ws.Range(topCell, topCell.End(xlDown))
            ' Add a checkbox
            Set cb = ws.CheckBoxes.Add(cell.Left, cell.Top, 50, 50)
            
            ' Link the checkbox to the corresponding cell
            With cb
                .LinkedCell = cell.Address
                .Text = ""
            End With
        Next cell
    End Sub

    Please note that VBA in Excel for Mac might have limitations compared to Excel for Windows. Additionally, you need to enable the "Developer" tab in Excel's Preferences to access VBA features. The text and steps were edited with the help of AI.

     

    My answers are voluntary and without guarantee!

     

    Hope this will help you.

    Was the answer useful? Mark as best response and Like it!

    This will help all forum participants.

    • ChakritW's avatar
      ChakritW
      Copper Contributor
      Thanks! So I have these options, excluding VBA:

      1. Migrate this sheet to Google Sheets, where I can also write AppScript in JS and all. (As I might need to share the sheet with my wife within our MS Office family accounts, this is not feasible)
      2. Use my another Windows PC to edit the sheet. (But these days I mostly use this Macbook)
      3. Stick with using "Y" / "N" values in cells, with list boxes.

      Seemed that's (3) for now. Until there are further changes that can make this possible in Excel for Mac.

Resources