Clear checkbox when workbook open advice

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
Office Version
  1. 2007
Platform
  1. Windows
I wish to clear either checkbox on sheet BIKES when a user opens a workbook.

On the BIKES sheet this works to clear checkbox for worksheet activate event

VBA Code:
Private Sub Worksheet_Activate()
   CheckBox1 = False
   CheckBox2 = False
End Sub

BUT it doesnt work for workbook open so please advise correct way.

VBA Code:
Private Sub Workbook_Open()
Application.EnableEvents = False
Sheets("BIKES") Checkbox1 = False
Sheets("BIKES") Checkbox2 = False
Application.EnableEvents = True
End Sub
 
Last edited by a moderator:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You need dots. Try this. Are your checkboxes ActiveX?
Rich (BB code):
Private Sub Workbook_Open()
Application.EnableEvents = False
Sheets("BIKES").Checkbox1 = False
Sheets("BIKES").Checkbox2 = False
Application.EnableEvents = True
End Sub
 
Upvote 0
Solution
Now sorted thanks all

VBA Code:
Private Sub Workbook_Open()
Application.EnableEvents = False
With Sheets("INV")
    .CheckBox1 = False
    .CheckBox2 = False
End With
Application.EnableEvents = True
End Sub
 
Upvote 0
Now sorted thanks all

The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,096
Members
453,021
Latest member
Justyna P

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