Results 1 to 3 of 3

Only run code on a checked box?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Only run code on a checked box?

    Hi is there a way to only run code in vba on a checked box (ActiveX)

    I have this.....

    Private Sub CheckBox1_Click()
    Dim OutlookApp As Object
    Dim Mess As Object, Recip
    Recip = [L7].Value
    Set OutlookApp = CreateObject("Outlook.Application")
    Set Mess = OutlookApp.CreateItem(olMailItem)
    With Mess
    .Subject = "Task Completed"
    .Body = "XXXXXX XXXXXX has completed task" & " " & Range("C7").Value
    .To = Recip
    .Display
    .Send
    End With
    End Sub
    But it runs when i check and uncheck the box, i dont want it to anything when i uncheck it, and have tried

    If checkbox value = !xon then cell = and also used a Change_Event for a cell so that it Calls a macro, and still cant get it to work only on a checked box.

    Any help?

    Dan
    Last edited by shiftyspina; 03-13-2014 at 10:48 AM. Reason: Name showing

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Check Box that shows options in Combo Box if Checked, and Hides if Not Checked
    By dumbjodie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-13-2013, 10:06 AM
  2. [SOLVED] I would like to run VBA code when a check box is checked.
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-01-2013, 06:59 PM
  3. [SOLVED] When checkbox is checked it does not copy to new sheet. Only if not checked using false
    By thelisa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2013, 07:59 AM
  4. Replies: 2
    Last Post: 12-19-2012, 11:23 PM
  5. [SOLVED] VBA code to get checked values and put one below another in another column
    By Anka in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2012, 08:24 PM

Tags for this Thread

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