How to uncheck all boxes except for a specific row

NeonLemon

New Member
Joined
Aug 19, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I currently have a worksheet that has check boxes in columns A, B, and C. I have a macro set to uncheck all the boxes on the sheet however I am wanting to exclude column A so that those boxes will remain checked at all times. Is there a way to do this? I'm very new to using VBA and any help would be greatly appreciated.

This is the code I am using to uncheck the boxes:

Sub ClearCheckBoxes()
'Updateby Extendoffice
Dim chkBox As Excel.CheckBox
Application.ScreenUpdating = False
For Each chkBox In ActiveSheet.CheckBoxes
chkBox.Value = xlOff
Next chkBox
Application.ScreenUpdating = True
End Sub
 

Attachments

  • 2022-08-19_07-10-02.jpg
    2022-08-19_07-10-02.jpg
    17.6 KB · Views: 12

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
You mean like this?

VBA Code:
Option Explicit

Sub ClearCheckBoxes()
    'Updateby Extendoffice
    Dim chkBox As Excel.CheckBox
    Application.ScreenUpdating = False
    For Each chkBox In ActiveSheet.CheckBoxes
        If Not chkBox.TopLeftCell.Column = 1 Then chkBox.Value = xlOff
    Next chkBox
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Solution
You mean like this?

VBA Code:
Option Explicit

Sub ClearCheckBoxes()
    'Updateby Extendoffice
    Dim chkBox As Excel.CheckBox
    Application.ScreenUpdating = False
    For Each chkBox In ActiveSheet.CheckBoxes
        If Not chkBox.TopLeftCell.Column = 1 Then chkBox.Value = xlOff
    Next chkBox
    Application.ScreenUpdating = True
End Sub
That is PERFECT thank you so much!!

You've just made my day
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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