Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2012, 12:49 AM
Control Control is offline Asking for Macro to Reset Checkbox Windows 7 32bit Asking for Macro to Reset Checkbox Office 2010 32bit
Novice
Asking for Macro to Reset Checkbox
 
Join Date: Dec 2012
Posts: 3
Control is on a distinguished road
Default Asking for Macro to Reset Checkbox

I need to make a button that reset a "check box" when it get pressed.
I have been trying to use that Macro
===
Sub Button2_Click()

checkbox1.Value = False

End Sub
=====


But it generate an error "Object required".
May I have an advice how to do that button with no errors ?

Last edited by Control; 12-09-2012 at 03:49 AM.
Reply With Quote
  #2  
Old 12-10-2012, 05:00 AM
davesexcel's Avatar
davesexcel davesexcel is offline Asking for Macro to Reset Checkbox Windows XP Asking for Macro to Reset Checkbox Office 2007
Novice
 
Join Date: Mar 2006
Posts: 7
davesexcel is on a distinguished road
Default

What type of checkbox is it?
Reply With Quote
  #3  
Old 12-11-2012, 03:21 AM
Control Control is offline Asking for Macro to Reset Checkbox Windows 7 32bit Asking for Macro to Reset Checkbox Office 2010 32bit
Novice
Asking for Macro to Reset Checkbox
 
Join Date: Dec 2012
Posts: 3
Control is on a distinguished road
Default

It is "Check Box (Form Control)". I get it from the "Developer" Tab, then "Insert", then "Check Box (Form Control)".
I can manager to use a different type, if that will make a difference.
I have attached my excel trial for refrence.
Attached Files
File Type: xlsm test.xlsm (16.8 KB, 9 views)
Reply With Quote
  #4  
Old 12-11-2012, 06:57 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Asking for Macro to Reset Checkbox Windows 7 32bit Asking for Macro to Reset Checkbox Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

The way your code is trying to access it would work if it were an ActiveX control (and if it were qualified with the parent sheet in the code). Since it is a forms control, you can access it like this:
Code:
Sub Button2_Click()
    Sheet1.CheckBoxes("Check Box 4").Value = False
End Sub
Where Sheet1 is the codename of the worksheet the checkbox lives on.
__________________
Colin

RAD Excel Blog
Reply With Quote
  #5  
Old 12-11-2012, 07:24 AM
Control Control is offline Asking for Macro to Reset Checkbox Windows 7 32bit Asking for Macro to Reset Checkbox Office 2010 32bit
Novice
Asking for Macro to Reset Checkbox
 
Join Date: Dec 2012
Posts: 3
Control is on a distinguished road
Default

Colin! Thanks indeed and highly appreciate it.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Asking for Macro to Reset Checkbox Macro to reset settings Jennifer Murphy Word VBA 1 08-02-2012 04:12 PM
Asking for Macro to Reset Checkbox Macro ? - Checkbox in Word + drop down selection help dice1976 Word 4 07-24-2012 11:18 AM
Macro to calculate a value of a checkbox. stephen_ Excel Programming 1 06-27-2012 04:57 PM
macro on checkbox macrohelp Word VBA 0 03-06-2009 03:33 PM
Reset on error kiwichico Word VBA 0 09-23-2008 08:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft