VBA Needed to Uncheck Boxes

Oceangirle

New Member
Joined
Mar 31, 2021
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello,

This is my first time posting. I am a bit perplexed on how to structure my VBA code to get started, as dealing with a dynamic tab coding issue is new territory for me.

I have a workbook whose sheets are labeled as follows (mm-yy) so the first sheet will be labeled (04-21) and then each month it will be copied and placed before with the tab name being manually updated to the next month (I.e. 05-21 will be a copy of 04-21 with a different sheet name). Once this is done, I would like the VBA code to clear the check boxes on the new sheet, but leave the check boxes as is on the old sheet. Thus , 05-21 should have no boxes checked, but 04-21 should have the same boxes checked as before. Any advice would be helpful for how to begin with the tab issue?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
hi and welcome to MrExcel
this will clear all checkboxes on your worksheet
call it as follows:
VBA Code:
ClearChecks "04-21"

VBA Code:
Sub ClearChecks(MyWS As Worksheet)
    Dim cbx As CheckBox

    For Each cbx In MyWS.CheckBoxes
      cbx.Value = False
    Next cbx
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,454
Members
448,898
Latest member
drewmorgan128

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