Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Clearing Check boxes

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    North Carolina
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm back again for more help. This site is great. Here's my problem: I have an Excel worksheet that includes both cells and check boxes where the user can input information. I want to automate the process when the user wants to clear the input sections. I've tied the following macro to a button:
    Sub Clear1()
    Dim MyVar
    MyVar = MsgBox("Are you sure you want to clear this record?", vbYesNo)
    If MyVar = vbYes Then
    Range("A5:N19").Select
    Selection.ClearContents
    ActiveWindow.SmallScroll Down:=12
    Range("M21:N23").Select
    Selection.ClearContents
    Range("H21:I23").Select
    Selection.ClearContents
    Range("C21:D23").Select
    Selection.ClearContents
    Sheets("Employee Guide").Select
    Range("C14:D14").Select
    Selection.ClearContents
    Range("C14").Select
    End If

    End Sub

    This works great to clear the cells. However, this does not clear the check boxes that are on the worksheet. I'm using the check boxes that are found on the "Forms" toolbar, not the ones found on the "Control Toolbox" toolbar. What do I need to add to my macro to accomplish this. Also, on a side note, is there any way to change the font color used with this type of check box? Thanks

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Posts
    363
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Assuming the check box is linked to cell A1, to clear it do the following:

    Range("a1") = False
    It's never too late to learn something new.

    Ricky

  3. #3
    New Member
    Join Date
    Apr 2002
    Location
    North Carolina
    Posts
    35
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Works Great!!! Thanks.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •