+ Reply to Thread
Results 1 to 6 of 6

send automated email with comment based on checked box

  1. #1
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    send automated email with comment based on checked box

    In the the code below I have changed the "x" to a checkbox and can not seem to get the syntax correct. Basically on an excel 2010 spreadsheet I have two comments that I am trying to use VB to send an email with the comment selected (checked). Thank you .

    VB

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: send automated email with comment based on checked box

    Hello cmccabe,

    It would be easier to spot the problem with a copy of the workbook. Can you post a copy?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: send automated email with comment based on checked box

    I have attached the spreadsheet and am getting a Type Mismatch error on the line in bold. Thank you .

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: send automated email with comment based on checked box

    Hello Christopher,

    I have been busy but have a solution to your problem. I created two macros for the ActiveX combo boxes.

    Since you are locating these by cell address, it is very important the check box fits inside the cell. The macro AddCheckBoxes will add an ActiveX check box and center it in each cell you have selected. This prevents errors in locating the check box by cell address.

    The second macro MapCheckBoxes creates a dictionary object to store the check boxes in. The check boxes are returned from the dictionary by the cell address. The cell address is in absolute A1 style, i.e. $A$1. If you enter a cell address that does not have a check box, an error will occur.

    I am not sure why you are using Chr(14) in your code, but I left it intact. I was going to change to Chr(13), carriage return, but decided perhaps the recipient's email client may require it.

    Here is the code that has been added...

    Module - Checkbox_Macros
    Please Login or Register  to view this content.
    CommandButton1_Click()
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    05-09-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    543

    Re: send automated email with comment based on checked box

    Thank you very much, works great .

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: send automated email with comment based on checked box

    Hello Christopher,

    You're welcome. If you have any questions about what the code does, please ask. I will be glad to explain it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How can I send a sheet in an Automated email with VBA?
    By gmr4evr1 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-28-2015, 10:10 AM
  2. [SOLVED] Automated Email VBA from Excel - Freezes before send
    By ELeGault in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-16-2014, 12:37 AM
  3. Send automated email if value in cell is value
    By DelKolio in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-16-2014, 08:53 AM
  4. Workflow with signatures (if cell=x then send email, if signed then send email)
    By Kate2811 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2014, 05:37 AM
  5. Macro to send automated email reminders
    By Amber12 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-13-2014, 11:22 AM
  6. command button VBA to send automated email not workbook or worksheet
    By lpratt in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-08-2012, 11:13 PM
  7. Automated email to send worksheet as report
    By wellseytd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2011, 10:28 AM

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