Results 1 to 10 of 10

Deselecting A CheckBox Automatically

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-24-2009
    Location
    SCOTLAND
    MS-Off Ver
    Excel Version 2308
    Posts
    151

    Deselecting A CheckBox Automatically


    I’m using this code to achieve the following;
    If the box is checked then a message box asks a question.
    If the answer is YES then the current date and users name is entered into cells E3 and F3.
    If the answer is NO then another message box appears with an instruction.
    Click Okay and any contents in cells E3 and F3 are cleared.

    However, I also want to remove the tick from the Check Box if the answer is NO.
    How can this be achieved as well?

    Sub CheckedByDate3csv()
        Dim ans
        If ActiveSheet.CheckBoxes(Application.Caller).Value = 1 Then
        ans = MsgBox("QUESTION HERE?", vbYesNo)
        If ans = vbYes Then
      'Continue
     'enters current date and users name into selected cells
            Range("E3") = Format(Now(), "dd-mm-yy")
            Range("F3") = Application.UserName
    End If
    
    If ans = vbNo Then
        MsgBox ("INSTRUCTION HERE."), vbInformation
        
            'clears current date and users name from selected cells
            Range("E3").ClearContents
            Range("F3").ClearContents
        End If
      End If
    End Sub
    Last edited by heliskier89; 06-17-2011 at 02:23 PM. Reason: Now Solved.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1