Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2008, 11:16 AM
Authorized User
 
Join Date: Aug 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default Excel Checkboxes

Hello:

I have a worksheet I'm using in Excel 2007 and it has a lot of information users fill out. I've got most of the code working right, but I cannot seem to find any good information on how to reset a checkbox.

My code is:
Code:
Sub Reset_Button()
'
' Reset_Button Macro
' Turn off screen flicker
    Application.ScreenUpdating = False

' Reset the Template
    Worksheets("Template_Type").Visible = xlSheetVisible
    Application.Goto Reference:="Template_Number"
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "1"
    Worksheets("Template_Type").Visible = xlSheetHidden

'Reset the Assets
    Worksheets("Asset_Type").Visible = xlSheetVisible
    Application.Goto Reference:="Asset_Type"
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B3").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B4").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B5").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B6").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B7").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B8").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B9").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B10").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B11").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B12").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B13").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B14").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B15").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B16").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B17").Select
    Worksheets("Asset_Type").Visible = xlSheetHidden

' Return to Coversheet sheet
    Sheets("Coversheet").Select

' Clean up rest of coversheet and reset values
    Application.Goto "Filename"
    Selection.Value = ""
    Application.Goto "Golive"
    Selection.Value = ""
    Application.Goto "Hub_Sun"
    Selection.Value = ""
    Application.Goto "School"
    Selection.Value = ""
    Application.Goto "Unit_Phase_Title"
    Selection.Value = ""
    Application.Goto "Unit_Phase_Number"
    Selection.Value = ""
    Application.Goto "Mega_Title"
    Selection.Value = ""

' Set it at Filename
    Range("C2").Select

' Turn screen clicker back on.
    Application.ScreenUpdating = True
End Sub
Right before the 'Set it at Filename comment, I need to reset to checkboxes to unchecked. Any help on this would be greatly appreciated. Also, I wouldn't complain if anyone had any thoughts on cleaning up the code either.

Thanks in advance for your help.
Arholly

 
Old August 7th, 2008, 11:32 AM
Authorized User
 
Join Date: Aug 2006
Posts: 85
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nevermind. I figured a way around it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview with checkboxes kgaughan1 ASP.NET 2.0 Professional 0 February 11th, 2007 11:31 PM
Listboxes and Checkboxes vanguardmike Classic ASP Basics 2 January 2nd, 2007 05:28 PM
how to control two checkboxes erin VBScript 5 October 27th, 2003 06:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.